mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
fix(server) combine: write error to pipe if headers sent
This commit is contained in:
parent
68c9c46d30
commit
6310b7c135
1 changed files with 11 additions and 2 deletions
|
|
@ -243,8 +243,17 @@
|
|||
dir : dir,
|
||||
write : stream,
|
||||
callback : function(error) {
|
||||
if (error)
|
||||
main.sendError(params, error);
|
||||
var errorStr;
|
||||
|
||||
if (error) {
|
||||
if (!p.response.headersSent)
|
||||
main.sendError(params, error);
|
||||
else {
|
||||
Util.log(error);
|
||||
errorStr = error.toString();
|
||||
stream.end(errorStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue