From 823009e9988ed6cd7b87a9f6571b02644844939a Mon Sep 17 00:00:00 2001 From: npmrun <1549469775@qq.com> Date: Fri, 15 May 2026 15:44:48 +0800 Subject: [PATCH] fix: make ApiError generic to preserve type information Co-Authored-By: Claude Opus 4.7 --- app/utils/http/factory.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/utils/http/factory.ts b/app/utils/http/factory.ts index 3e77bc0..444597d 100644 --- a/app/utils/http/factory.ts +++ b/app/utils/http/factory.ts @@ -8,8 +8,8 @@ export type ApiResponse = { } /** Wraps API error responses, preserving the data field for field-level error handling */ -export class ApiError extends Error { - constructor(message: string, public data: unknown) { +export class ApiError extends Error { + constructor(message: string, public data: T) { super(message) this.name = 'ApiError' }