Files
zod-backend/src/core/exceptions/custom-rpc.exception.ts
Oracle Public Cloud User 05872b5170 feat:mvp1 initial commit
2024-11-21 06:07:08 +00:00

23 lines
459 B
TypeScript

export interface IRpcError {
message: string;
status?: number;
}
export class CustomRpcException {
private readonly rpcError: IRpcError;
constructor(exception: any) {
this.rpcError =
(exception.rpcError as IRpcError) || // propagate RPC error if any
({
message: exception.message,
status: exception.status,
} as IRpcError);
}
// for testing
public getError(): IRpcError {
return this.rpcError;
}
}