How to get SQLSTATE in bookshelf.js?

2019-07-09 12:52发布

问题:

How does one detect the type of an error that occurs in bookshelf.js when talking to PostgreSQL (or another RDBMS)?

Prompted by this question; I don't use bookshelf.js myself.

A search of the manual did not reveal much that was enlightening.