1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix error handling in runtime/lib/api/nodes

This commit is contained in:
Nick O'Leary 2021-05-13 15:46:56 +01:00
parent 2bbdc85a29
commit d7dc7c4eda
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -272,7 +272,7 @@ var api = module.exports = {
} catch(error) {
runtime.log.audit({event: "nodes.remove",module:opts.module,error:error.code||"unexpected_error",message:error.toString()}, opts.req);
error.status = 400;
throw err;
throw error;
}
},
@ -319,7 +319,7 @@ var api = module.exports = {
} catch(error) {
runtime.log.audit({event: "nodes.module.set",module:mod,enabled:opts.enabled,error:error.code||"unexpected_error",message:error.toString()}, opts.req);
error.status = 400;
throw err;
throw error;
}
},
@ -366,7 +366,7 @@ var api = module.exports = {
} catch(error) {
runtime.log.audit({event: "nodes.info.set",id:id,enabled:enabled,error:error.code||"unexpected_error",message:error.toString()}, opts.req);
error.status = 400;
throw err;
throw error;
}
},