mirror of https://github.com/adamdruppe/arsd.git
stderr
This commit is contained in:
parent
933aa566d3
commit
c826aad6e5
3
cgi.d
3
cgi.d
|
@ -1750,6 +1750,7 @@ mixin template CustomCgiMain(CustomCgi, alias fun, T...) if(is(CustomCgi : Cgi))
|
||||||
} catch(Throwable t) {
|
} catch(Throwable t) {
|
||||||
// a construction error is either bad code or bad request; bad request is what it should be since this is bug free :P
|
// a construction error is either bad code or bad request; bad request is what it should be since this is bug free :P
|
||||||
// anyway let's kill the connection
|
// anyway let's kill the connection
|
||||||
|
stderr.writeln(t.toString());
|
||||||
sendAll(connection, plainHttpError(false, "400 Bad Request", t));
|
sendAll(connection, plainHttpError(false, "400 Bad Request", t));
|
||||||
closeConnection = true;
|
closeConnection = true;
|
||||||
break;
|
break;
|
||||||
|
@ -2227,7 +2228,7 @@ void sendAll(Socket s, const(void)[] data) {
|
||||||
do {
|
do {
|
||||||
amount = s.send(data);
|
amount = s.send(data);
|
||||||
if(amount == Socket.ERROR)
|
if(amount == Socket.ERROR)
|
||||||
throw new Exception("wtf in send");
|
throw new Exception("wtf in send: " ~ lastSocketError());
|
||||||
assert(amount > 0);
|
assert(amount > 0);
|
||||||
data = data[amount .. $];
|
data = data[amount .. $];
|
||||||
} while(data.length);
|
} while(data.length);
|
||||||
|
|
Loading…
Reference in New Issue