ER_DUP_ENTRY is passed as code and not in message
This commit is contained in:
@@ -545,7 +545,7 @@ function getDuplicateErrorDetails(errorMessage, locations, portBindings) {
|
||||
assert(Array.isArray(locations));
|
||||
assert.strictEqual(typeof portBindings, 'object');
|
||||
|
||||
const match = errorMessage.match(/ER_DUP_ENTRY: Duplicate entry '(.*)' for key '(.*)'/);
|
||||
const match = errorMessage.match(/Duplicate entry '(.*)' for key '(.*)'/);
|
||||
if (!match) {
|
||||
debug('Unexpected SQL error message.', errorMessage);
|
||||
return new BoxError(BoxError.DATABASE_ERROR, errorMessage);
|
||||
|
||||
Reference in New Issue
Block a user