fix: transaction locking handling

This commit is contained in:
Ahmed Bouhuolia
2025-12-05 23:47:29 +02:00
parent bc21dcb37e
commit d006362be2
7 changed files with 60 additions and 58 deletions

View File

@@ -4,16 +4,18 @@ export class ServiceError extends Error {
errorType: string;
message: string;
payload: any;
httpStatus: HttpStatus;
constructor(errorType: string, message?: string, payload?: any) {
constructor(errorType: string, message?: string, payload?: any, httpStatus?: HttpStatus) {
super(message);
this.errorType = errorType;
this.message = message || null;
this.payload = payload;
this.httpStatus = httpStatus || HttpStatus.BAD_REQUEST;
}
getStatus(): HttpStatus {
return HttpStatus.INTERNAL_SERVER_ERROR;
return this.httpStatus;
}
}