refs err.sqlMessage
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
a5d1c68511
commit
52f58a92c8
|
@ -10,8 +10,7 @@ module.exports = Self => {
|
|||
require('../methods/invoice-in/invoiceInEmail')(Self);
|
||||
require('../methods/invoice-in/getSerial')(Self);
|
||||
Self.rewriteDbError(function(err) {
|
||||
console.log(err);
|
||||
if (err.code === 'ER_ROW_IS_REFERENCED_2')
|
||||
if (err.code === 'ER_ROW_IS_REFERENCED_2' && err.sqlMessage.includes('vehicleInvoiceIn'))
|
||||
return new UserError(`This invoice has a linked vehicle.`);
|
||||
return err;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue