Alexandre Bodin 0db015e6c2 Update tests
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-02 19:41:45 +01:00

16 lines
337 B
JavaScript

'use strict';
module.exports = fn => async () => {
try {
await fn();
} catch (error) {
if (strapi.errors.isBoom(error)) {
throw error;
}
// these are errors like unique constraints
strapi.log.error(error);
throw strapi.errors.badRequest('Invalid input data. Please verify unique constraints');
}
};