feat(errors): add centralized exception handling

This commit is contained in:
2026-07-03 12:55:45 +08:00
parent e852fb62e9
commit 65d972fbb4
20 changed files with 492 additions and 70 deletions
@@ -1,3 +1,4 @@
import { ExceptionHandler } from "@/core/errors";
import { PaymentPlan, type PaymentPlansResponse } from "@/data/dto/payment";
import type { PaymentState } from "./payment-state";
@@ -7,7 +8,7 @@ export const PAYMENT_TIMEOUT_ERROR_MESSAGE =
"Payment timed out. Please try again.";
export function toPaymentErrorMessage(error: unknown): string {
return error instanceof Error ? error.message : String(error);
return ExceptionHandler.message(error);
}
export function hasOrderPollingTimedOut(