pop vehicle error #1672

Merged
carlossa merged 5 commits from hotfix-vehicleError into master 2023-07-19 05:50:40 +00:00
1 changed files with 1 additions and 1 deletions
Showing only changes of commit 10e726c486 - Show all commits

View File

@ -2,7 +2,7 @@ let UserError = require('vn-loopback/util/user-error');
module.exports = Self => { module.exports = Self => {
Self.rewriteDbError(function(err) { Self.rewriteDbError(function(err) {
if (err.code === 'ER_ROW_IS_REFERENCED') if (err.code === 'ER_ROW_IS_REFERENCED_2')
return new UserError(`This invoice has a linked vehicle.`); return new UserError(`This invoice has a linked vehicle.`);
return err; return err;
}); });