From 6bddb611fcacf6b51378075d17d827eaf5ad7649 Mon Sep 17 00:00:00 2001 From: Anton Podviaznikov Date: Tue, 14 Jun 2016 12:36:59 -0700 Subject: [PATCH 1/4] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e0839d5..10e530d 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "amqplib": "^0.4.1", "bluebird": "^3.0.5", "bunyan": "^1.5.1", - "error-cat": "^2.0.4", + "error-cat": "^3.0.0", "immutable": "^3.8.1", "monitor-dog": "1.5.0", "uuid": "^2.0.2" From aeda3508997dc953ed796824d168a1085749daca Mon Sep 17 00:00:00 2001 From: Anton Podviaznikov Date: Tue, 14 Jun 2016 14:29:13 -0700 Subject: [PATCH 2/4] fix tests --- test/unit/worker.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/unit/worker.js b/test/unit/worker.js index f0f58c9..4ecd982 100644 --- a/test/unit/worker.js +++ b/test/unit/worker.js @@ -624,6 +624,7 @@ describe('Worker', () => { const stopError = new WorkerStopError( 'my message', { dog: 'robot' }, + { level: 'info' }, 'some.queue', { foo: 'bar' } ) @@ -632,6 +633,7 @@ describe('Worker', () => { .then(() => { const decoratedError = worker._reportError.firstCall.args[0] assert.deepEqual(decoratedError, stopError) + assert.deepEqual(decoratedError.reporting, { level: 'info' }) assert.deepEqual(decoratedError.data.queue, 'some.queue') assert.deepEqual(decoratedError.data.job, { foo: 'bar' }) }) From 74702e63d2dc5497e8383de54095605864e2b9f3 Mon Sep 17 00:00:00 2001 From: Bryan Kendall Date: Tue, 14 Jun 2016 14:59:26 -0700 Subject: [PATCH 3/4] update flowtype definition of error --- interfaces/modules/error-cat.js.flow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/modules/error-cat.js.flow b/interfaces/modules/error-cat.js.flow index 46b471a..9410da8 100644 --- a/interfaces/modules/error-cat.js.flow +++ b/interfaces/modules/error-cat.js.flow @@ -7,7 +7,7 @@ declare module 'error-cat' { } declare class WorkerStopError extends Error { - static constructor(message: string, data?: Object, queue?: string, job: Object): WorkerStopError; + static constructor(message: string, data?: Object, reporting?: Object, queue?: string, job?: Object): WorkerStopError; } declare module 'error-cat/errors/worker-stop-error' { From bd9ea28fb09eef147c228ea38480b9d88449f892 Mon Sep 17 00:00:00 2001 From: Bryan Kendall Date: Tue, 14 Jun 2016 15:14:11 -0700 Subject: [PATCH 4/4] add error-cat as a peer dependency to help prevent issues with mismatches --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 10e530d..1208bf3 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,9 @@ "afterEach" ] }, + "peerDependencies": { + "error-cat": "^3.0.0" + }, "dependencies": { "101": "^1.1.1", "amqplib": "^0.4.1",