Skip to content

Commit 73e72d1

Browse files
committed
feat: deserialize error after it comes in
BREAKING CHANGE: error format would change to an Error object and not serialized js object with properties
1 parent 17fe339 commit 73e72d1

3 files changed

Lines changed: 715 additions & 564 deletions

File tree

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,28 @@
3434
"ioredis": "~4.x.x"
3535
},
3636
"dependencies": {
37-
"bluebird": "^3.5.5",
37+
"bluebird": "^3.7.1",
3838
"bunyan": "^1.8.12",
3939
"callback-queue": "^3.0.0",
4040
"denque": "^1.4.1",
4141
"ioredis-lock": "^4.0.0",
4242
"lodash": "^4.17.15",
43-
"serialize-error": "^4.1.0"
43+
"serialize-error": "^5.0.0"
4444
},
4545
"devDependencies": {
46-
"@babel/cli": "^7.6.0",
47-
"@babel/core": "^7.6.0",
46+
"@babel/cli": "^7.6.4",
47+
"@babel/core": "^7.6.4",
4848
"@babel/plugin-transform-strict-mode": "^7.0.0",
49-
"@makeomatic/deploy": "^8.4.7",
50-
"codecov": "^3.5.0",
51-
"cross-env": "^5.2.1",
52-
"eslint": "^6.3.0",
53-
"eslint-config-makeomatic": "^3.1.0",
49+
"@makeomatic/deploy": "^9.3.2",
50+
"codecov": "^3.6.1",
51+
"cross-env": "^6.0.3",
52+
"eslint": "^6.5.1",
53+
"eslint-config-makeomatic": "^4.0.0",
5454
"eslint-plugin-import": "^2.18.2",
5555
"eslint-plugin-promise": "^4.2.1",
56-
"ioredis": "^4.14.0",
56+
"ioredis": "^4.14.1",
5757
"jest": "^24.9.0",
58-
"sinon": "^7.4.2"
58+
"sinon": "^7.5.0"
5959
},
6060
"engine": {
6161
"node": ">= 10.15.0"

src/callback-queue.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const Promise = require('bluebird');
22
const callbackQueue = require('callback-queue');
3-
const serializeError = require('serialize-error');
3+
const { serializeError, deserializeError } = require('serialize-error');
44

55
// callback buckets
66
const queue = new Map();
@@ -115,6 +115,7 @@ exports.createConsumer = function createConsumer(redis, pubsubChannel, logger) {
115115
// no listeners here
116116
// eat the error
117117
try {
118+
if (args[0]) args[0] = deserializeError(args[0]);
118119
await call(key, args, logger);
119120
} catch (err) {
120121
logger.warn({ err }, 'call failed');

0 commit comments

Comments
 (0)