@companydev/shared-kernel
Version:
Shared kernel for DDD hexagonal architecture
19 lines • 690 B
JavaScript
// src/application/exceptions/unauthorized-operation.exception.ts
import { ApplicationExceptionBase } from './application-exception.base.js';
export class UnauthorizedOperationException extends ApplicationExceptionBase {
constructor(params) {
super(`No autorizado para realizar '${params.operation}': ${params.reason}`);
this.operation = params.operation;
this.reason = params.reason;
}
getErrorCode() {
return 'UNAUTHORIZED_OPERATION';
}
getHttpStatus() {
return 403;
}
static create(params) {
return new UnauthorizedOperationException(params);
}
}
//# sourceMappingURL=unauthorized-operation.exception.js.map