@imqueue/rpc 1.17.0 → 1.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/IMQLock.js +8 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imqueue/rpc",
3
- "version": "1.17.0",
3
+ "version": "1.17.1",
4
4
  "description": "RPC-like client-service implementation over messaging queue",
5
5
  "keywords": [
6
6
  "redis",
package/src/IMQLock.js CHANGED
@@ -80,7 +80,14 @@ class IMQLock {
80
80
  if (IMQLock.deadlockTimeout) {
81
81
  // avoid dead-locks using timeouts
82
82
  timer = setTimeout(() => {
83
- const err = new Error(`Lock timeout, "${key}" call rejected, metadata: ${JSON.stringify(IMQLock.metadata[key])}`);
83
+ let dumpStr = '';
84
+ try {
85
+ dumpStr = JSON.stringify(IMQLock.metadata[key]);
86
+ }
87
+ catch (err) {
88
+ dumpStr = 'Unable to stringify metadata';
89
+ }
90
+ const err = new Error(`Lock timeout, "${key}" call rejected, metadata: ${dumpStr}`);
84
91
  clearTimeout(timer);
85
92
  timer = null;
86
93
  IMQLock.release(key, null, err);