salix/modules/item/back/models/item-niche.js

10 lines
267 B
JavaScript
Raw Normal View History

2018-12-27 11:54:16 +00:00
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
Self.rewriteDbError(function(err) {
if (err.code === 'ER_DUP_ENTRY')
return new UserError(`The warehouse can't be repeated`);
return err;
});
2018-02-20 11:25:51 +00:00
};