mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
introduced new exception classes for structured error reporting
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user