update database error messages

This commit is contained in:
Julian Krauser 2025-01-29 09:42:22 +01:00
parent f89483f878
commit f245ff74a8
72 changed files with 325 additions and 441 deletions

View file

@ -1,6 +1,7 @@
import { dataSource } from "../../data-source";
import { rolePermission } from "../../entity/user/role_permission";
import { userPermission } from "../../entity/user/user_permission";
import DatabaseActionException from "../../exceptions/databaseActionException";
import InternalException from "../../exceptions/internalException";
export default abstract class RolePermissionService {
@ -19,7 +20,7 @@ export default abstract class RolePermissionService {
return res;
})
.catch((err) => {
throw new InternalException("permissions not found by role", err);
throw new DatabaseActionException("SELECT", "rolePermission", err);
});
}
@ -38,7 +39,7 @@ export default abstract class RolePermissionService {
return res;
})
.catch((err) => {
throw new InternalException("permissions not found by roles", err);
throw new DatabaseActionException("SELECT", "rolePermission", err);
});
}
}