small refactorings

This commit is contained in:
zadam
2023-05-04 22:16:18 +02:00
parent ecd2a5cbac
commit 8edf06d28d
28 changed files with 49 additions and 44 deletions

View File

@@ -24,7 +24,7 @@ function moveBranchToParent(req) {
const branchToMove = becca.getBranch(branchId);
if (!parentBranch || !branchToMove) {
throw new ValidationError(`One or both branches ${branchId}, ${parentBranchId} have not been found`);
throw new ValidationError(`One or both branches '${branchId}', '${parentBranchId}' have not been found`);
}
return branchService.moveBranchToBranch(branchToMove, parentBranch, branchId);

View File

@@ -93,7 +93,7 @@ function updateOptions(req) {
if (!update(optionName, req.body[optionName])) {
// this should be improved
// it should return 400 instead of current 500, but at least it now rollbacks transaction
throw new Error(`${optionName} is not allowed to change`);
throw new Error(`Option '${optionName}' is not allowed to be changed`);
}
}
}