salix/modules/supplier/back/models/supplier-agency-term.js

10 lines
288 B
JavaScript
Raw Permalink Normal View History

2022-03-28 11:35:36 +00:00
const UserError = require('vn-loopback/util/user-error');
2022-03-09 22:54:23 +00:00
module.exports = Self => {
Self.rewriteDbError(function(err) {
if (err.code === 'ER_DUP_ENTRY')
return new UserError(`The agency is already assigned to another autonomous`);
return err;
});
};