pg-promise: queryResultErrorCode

/node_modules/pg-promise/lib/errors/queryResult.js:151
            gap1 + 'code: queryResultErrorCode.' + errorMessages[this.code].name,
                                                                                                                           ^
TypeError: Cannot read property 'name' of undefined
db.one('SELECT * FROM users WHERE id = $1', 1)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 26 (15 by maintainers)

Most upvoted comments

Just a note if anyone else still sees similar errors (version: 6.3.1)

You get the error bellow if you are using bluebird somewhere in the chain and have not set pg-promise to use bluebrid. At least in my case.

TypeError: Cannot set property 'name' of undefined
      at QueryResultError (node_modules/pg-promise/lib/errors/queryResult.js:122:27)
      at process._tickCallback (internal/process/next_tick.js:109:7)

@vitaly-t Everything works. Thank you.

@anonrig it works either way.