Merge branch 'dev' into 2657-zone_log
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-12-29 13:08:22 +00:00
commit 45fac5d71d
1 changed files with 8 additions and 2 deletions

View File

@ -145,9 +145,15 @@ module.exports = function(Self) {
rewriteDbError(replaceErrFunc) { rewriteDbError(replaceErrFunc) {
function replaceErr(err, replaceErrFunc) { function replaceErr(err, replaceErrFunc) {
if (Array.isArray(err)) { if (Array.isArray(err)) {
const errors = err.filter(error => {
return error != undefined && error != null;
});
let errs = []; let errs = [];
for (let e of err) for (let e of errors) {
if (!(e instanceof UserError))
errs.push(replaceErrFunc(e)); errs.push(replaceErrFunc(e));
else errs.push(e);
}
return errs; return errs;
} }
return replaceErrFunc(err); return replaceErrFunc(err);