mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 22:05:44 +01:00
introduced new exception classes for structured error reporting
This commit is contained in:
@@ -6,6 +6,7 @@ const myScryptService = require('../services/my_scrypt');
|
||||
const log = require('../services/log');
|
||||
const passwordService = require("../services/password");
|
||||
const assetPath = require("../services/asset_path");
|
||||
const ValidationError = require("../public/app/services/validation_error.js");
|
||||
|
||||
function loginPage(req, res) {
|
||||
res.render('login', {
|
||||
@@ -23,7 +24,7 @@ function setPasswordPage(req, res) {
|
||||
|
||||
function setPassword(req, res) {
|
||||
if (passwordService.isPasswordSet()) {
|
||||
return [400, "Password has been already set"];
|
||||
throw new ValidationError("Password has been already set");
|
||||
}
|
||||
|
||||
let {password1, password2} = req.body;
|
||||
|
||||
Reference in New Issue
Block a user