salix/modules/ticket/back/models/ticket-observation.js

10 lines
274 B
JavaScript
Raw Permalink Normal View History

2018-12-27 11:54:16 +00:00
const UserError = require('vn-loopback/util/user-error');
2018-08-30 09:02:50 +00:00
module.exports = Self => {
Self.rewriteDbError(function(err) {
if (err.code === 'ER_DUP_ENTRY')
return new UserError(`The observation type can't be repeated`);
return err;
});
2018-03-16 14:06:42 +00:00
};