Skip to content

Commit

Permalink
Fix error messages when first starting up
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgleason committed Sep 15, 2024
1 parent 4baef5e commit 774c7a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deno/src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,9 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
}

function queryError(query, err) {
Object.defineProperties(err, {
if (typeof query !== 'object') throw err

'query' in err || 'parameters' in err || Object.defineProperties(err, {
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 },
Expand Down
2 changes: 2 additions & 0 deletions src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ function Connection(options, queues = {}, { onopen = noop, onend = noop, onclose
}

function queryError(query, err) {
if (typeof query !== 'object') throw err

'query' in err || 'parameters' in err || Object.defineProperties(err, {
stack: { value: err.stack + query.origin.replace(/.*\n/, '\n'), enumerable: options.debug },
query: { value: query.string, enumerable: options.debug },
Expand Down

0 comments on commit 774c7a1

Please sign in to comment.