Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Driver throw SqlError object defined like this :
export interface SqlError extends Error { |
/** |
* Either a MySQL server error (e.g. 'ER_ACCESS_DENIED_ERROR'),
|
* a node.js error (e.g. 'ECONNREFUSED') or an internal error
|
* (e.g. 'PROTOCOL_CONNECTION_LOST').
|
*/
|
code: string | null; |
|
/** |
* The error number for the error code
|
*/
|
errno: number;
|
|
/** |
* The sql state
|
*/
|
sqlState?: string | null; |
|
/** |
* Boolean, indicating if this error is terminal to the connection object.
|
*/
|
fatal: boolean; |
}
|
extending Error with message value.
Problem is that message as additional value added :
example 'My error label' => message will be `(conn=5149, no: 1644, SQLState: 45000) My error label` + sql + stack
This consist to adding 2 properties : initial message error and sql.