mirror of
https://github.com/immich-app/immich.git
synced 2025-12-18 18:32:29 -08:00
49 lines
2.7 KiB
Diff
49 lines
2.7 KiB
Diff
diff --git a/cf/src/connection.js b/cf/src/connection.js
|
|
index ee8b1e69055bef090d322a66c7d792b5b502f47a..acf45662b35a8d01fa0d198faf6337d9f6808f3f 100644
|
|
--- a/cf/src/connection.js
|
|
+++ b/cf/src/connection.js
|
|
@@ -387,8 +387,10 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
|
}
|
|
|
|
function queryError(query, err) {
|
|
+ if (!query || typeof query !== 'object' || !query.reject) throw err
|
|
+
|
|
'query' in err || 'parameters' in err || Object.defineProperties(err, {
|
|
- stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug },
|
|
+ stack: { value: err.stack + (query.origin || '').replace(/.*\n/, '\n'), enumerable: options.debug },
|
|
query: { value: query.string, enumerable: options.debug },
|
|
parameters: { value: query.parameters, enumerable: options.debug },
|
|
args: { value: query.args, enumerable: options.debug },
|
|
diff --git a/cjs/src/connection.js b/cjs/src/connection.js
|
|
index f7f58d147f344cb7f2420c2bd24c6b7917162033..b7f2d657c9e1d5fbc7ce4735f61abae972959b1e 100644
|
|
--- a/cjs/src/connection.js
|
|
+++ b/cjs/src/connection.js
|
|
@@ -385,8 +385,10 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
|
}
|
|
|
|
function queryError(query, err) {
|
|
+ if (!query || typeof query !== 'object' || !query.reject) throw err
|
|
+
|
|
'query' in err || 'parameters' in err || Object.defineProperties(err, {
|
|
- stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug },
|
|
+ stack: { value: err.stack + (query.origin || '').replace(/.*\n/, '\n'), enumerable: options.debug },
|
|
query: { value: query.string, enumerable: options.debug },
|
|
parameters: { value: query.parameters, enumerable: options.debug },
|
|
args: { value: query.args, enumerable: options.debug },
|
|
diff --git a/src/connection.js b/src/connection.js
|
|
index 97cc97e1576d6c75f958c66e9cecbf8cd11ed450..26f508e2de12f09f27838aca8d88fa4721fe6677 100644
|
|
--- a/src/connection.js
|
|
+++ b/src/connection.js
|
|
@@ -385,8 +385,10 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
|
|
}
|
|
|
|
function queryError(query, err) {
|
|
+ if (!query || typeof query !== 'object' || !query.reject) throw err
|
|
+
|
|
'query' in err || 'parameters' in err || Object.defineProperties(err, {
|
|
- stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug },
|
|
+ stack: { value: err.stack + (query.origin || '').replace(/.*\n/, '\n'), enumerable: options.debug },
|
|
query: { value: query.string, enumerable: options.debug },
|
|
parameters: { value: query.parameters, enumerable: options.debug },
|
|
args: { value: query.args, enumerable: options.debug },
|