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 { refresh } from "../entity/refresh";
import { PWA_REFRESH_EXPIRATION, REFRESH_EXPIRATION } from "../env.defaults";
import DatabaseActionException from "../exceptions/databaseActionException";
import InternalException from "../exceptions/internalException";
import { StringHelper } from "../helpers/stringHelper";
import UserService from "../service/user/userService";
@ -32,7 +33,7 @@ export default abstract class RefreshCommandHandler {
return refreshToken;
})
.catch((err) => {
throw new InternalException("Failed saving refresh token", err);
throw new DatabaseActionException("CREATE", "refresh", err);
});
}
@ -51,7 +52,7 @@ export default abstract class RefreshCommandHandler {
.execute()
.then((res) => {})
.catch((err) => {
throw new InternalException("failed refresh removal", err);
throw new DatabaseActionException("DELETE", "refresh", err);
});
}
@ -68,7 +69,7 @@ export default abstract class RefreshCommandHandler {
.execute()
.then((res) => {})
.catch((err) => {
throw new InternalException("failed expired refresh removal", err);
throw new DatabaseActionException("DELETE", "refresh", err);
});
}
}