introduced new exception classes for structured error reporting

This commit is contained in:
zadam
2022-12-09 16:04:13 +01:00
parent eaf195e0c8
commit 342ae6e5e2
27 changed files with 123 additions and 64 deletions

View File

@@ -3,6 +3,7 @@
const optionService = require('../../services/options');
const log = require('../../services/log');
const searchService = require('../../services/search/services/search');
const ValidationError = require("../../public/app/services/validation_error.js");
// options allowed to be updated directly in options dialog
const ALLOWED_OPTIONS = new Set([
@@ -82,7 +83,7 @@ function updateOption(req) {
const {name, value} = req.params;
if (!update(name, value)) {
return [400, "not allowed option to change"];
throw new ValidationError("not allowed option to change");
}
}