salix/modules/worker/back/models/device.js

12 lines
287 B
JavaScript
Raw Normal View History

2019-06-03 07:20:20 +00:00
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
require('../methods/device/checkUuid')(Self);
Self.rewriteDbError(function(err) {
if (err.code === 'ER_DUP_ENTRY')
return new UserError(``);
return err;
});
};