feat: refs #7323 show right error
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
d8e0c1debe
commit
f3b5a70b67
|
@ -217,6 +217,7 @@ module.exports = Self => {
|
|||
const code = e.code;
|
||||
const message = e.sqlMessage;
|
||||
|
||||
if (e.message && e.message.includes('Invalid email')) throw new UserError('Invalid email');
|
||||
if (e.message && e.message.includes(`Email already exists`)) throw new UserError(`This personal mail already exists`);
|
||||
if (code === 'ER_DUP_ENTRY' && message.includes(`CodigoTrabajador_UNIQUE`)) throw new UserError(`This worker code already exists`);
|
||||
if (code === 'ER_DUP_ENTRY' && message.includes(`PRIMARY`)) throw new UserError(`This worker already exists`);
|
||||
|
|
Loading…
Reference in New Issue