/** * 余额不足异常 - 402 状态码(类似 Payment Required) */ import { HttpException, HttpStatus } from '@nestjs/common'; export class InsufficientBalanceException extends HttpException { constructor( message = '余额不足', public readonly required: bigint, public readonly available: bigint, ) { super( { statusCode: HttpStatus.PAYMENT_REQUIRED, message, required: Number(required), available: Number(available) }, HttpStatus.PAYMENT_REQUIRED, ); } }