|
|
@ -8,8 +8,8 @@ export type ApiResponse<T = unknown> = { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** Wraps API error responses, preserving the data field for field-level error handling */ |
|
|
/** Wraps API error responses, preserving the data field for field-level error handling */ |
|
|
export class ApiError extends Error { |
|
|
export class ApiError<T = unknown> extends Error { |
|
|
constructor(message: string, public data: unknown) { |
|
|
constructor(message: string, public data: T) { |
|
|
super(message) |
|
|
super(message) |
|
|
this.name = 'ApiError' |
|
|
this.name = 'ApiError' |
|
|
} |
|
|
} |
|
|
|