[CONJS-213] update error code with recent MariaDB server Created: 2022-08-17  Updated: 2022-08-17  Resolved: 2022-08-17

Status: Closed
Project: MariaDB Connector/node.js
Component/s: other
Affects Version/s: None
Fix Version/s: 3.0.2

Type: Task Priority: Minor
Reporter: Diego Dupin Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None


 Description   

In order to be compatible with mysql/mysql2 connectors, connector error have a property error.code that correspond to server error code .

example:

SqlError: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'wrong query' at line 1
sql: wrong query - parameters:[]
    at Object.module.exports.createError (C:\temp\mariadb-connector-.
    ...  
  sql: 'wrong query - parameters:[]',
  fatal: false,
  errno: 1064,
  sqlState: '42000',
  code: 'ER_PARSE_ERROR'
}

This code, 'ER_PARSE_ERROR' in example has then be used to compare error in different framework.

Connector error code list must be update to recent MariaDB 10.9 error code (actually use 10.6 error code list)


Generated at Thu Feb 08 03:23:35 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.