14 lines
438 B
TypeScript
14 lines
438 B
TypeScript
import { HttpException } from '@nestjs/common';
|
|
import type { ApiErrorReason } from '@doodle/contracts';
|
|
|
|
/** 仅由可信业务创建,过滤器只输出已登记原因,不透传第三方异常原文。 */
|
|
export class ApiException extends HttpException {
|
|
constructor(
|
|
status: number,
|
|
readonly reason: ApiErrorReason,
|
|
readonly retryAfterSeconds?: number,
|
|
) {
|
|
super({ reason }, status);
|
|
}
|
|
}
|