Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better handling of mid-response errors

  • Loading branch information...
commit cdf59a1bca031f728e586572806aba42a036155d 1 parent bd55a1d
@kriszyp authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 jsgi-node.js
View
5 jsgi-node.js
@@ -197,11 +197,14 @@ function Response( response, stream ) {
}
try{
// if it is not too late, set the status
- response.writeHead(500, {});
+ if(!response.statusCode){
+ response.writeHead(500, {});
+ }
}catch(e2){}
try{
response.write( "Error: " + e.stack );
response.end();
+ console.log("error",e);
}catch(e3){
sys.puts(e3.stack);
}
Please sign in to comment.
Something went wrong with that request. Please try again.