mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
feature(rest) add request.on error
This commit is contained in:
parent
b1c22c9344
commit
d54954a60d
1 changed files with 5 additions and 3 deletions
|
|
@ -92,7 +92,7 @@
|
|||
}
|
||||
|
||||
function onFS(pParams){
|
||||
var p, lWriteStream, lSize, lQuery,
|
||||
var p, lError, lWriteStream, lSize, lQuery,
|
||||
lRet = main.checkParams(pParams);
|
||||
if(lRet){
|
||||
p = pParams,
|
||||
|
|
@ -168,10 +168,12 @@
|
|||
else {
|
||||
lWriteStream = fs.createWriteStream(p.name);
|
||||
|
||||
lWriteStream.on('error', function(pError){
|
||||
lError = function(pError){
|
||||
main.sendError(pParams, pError);
|
||||
});
|
||||
};
|
||||
|
||||
lWriteStream.on ('error', lError);
|
||||
p.request.on('error', lError);
|
||||
p.request.on('end', function(){
|
||||
main.sendResponse(pParams, 'write: ' + p.name);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue