json-rpc-engine
Advanced tools
Comparing version 3.1.0 to 3.2.0
{ | ||
"name": "json-rpc-engine", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "a tool for processing JSON RPC", | ||
@@ -21,3 +21,4 @@ "main": "src/index.js", | ||
"babel-preset-env": "^1.3.2", | ||
"babelify": "^7.3.0" | ||
"babelify": "^7.3.0", | ||
"json-rpc-error": "^2.0.0" | ||
}, | ||
@@ -54,2 +55,2 @@ "browserify": { | ||
] | ||
} | ||
} |
'use strict' | ||
const async = require('async') | ||
const JsonRpcError = require('json-rpc-error') | ||
@@ -38,3 +39,8 @@ class RpcEngine { | ||
this._runMiddleware(req, res, (err, isComplete) => { | ||
if (err) return cb(err) | ||
if (err) { | ||
// prepare error message | ||
res.error = new JsonRpcError.InternalError(err) | ||
// return error-first and res with err | ||
return cb(err, res) | ||
} | ||
// fail if not completed | ||
@@ -41,0 +47,0 @@ if (!isComplete) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15634
372
4
339217
+ Addedjson-rpc-error@^2.0.0
+ Addedcaniuse-lite@1.0.30001679(transitive)
+ Addedelectron-to-chromium@1.5.55(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedjson-rpc-error@2.0.0(transitive)
- Removedcaniuse-lite@1.0.30001680(transitive)
- Removedelectron-to-chromium@1.5.59(transitive)