Browse Source

fix: make ApiError generic to preserve type information

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
feat/registration-page
npmrun 2 weeks ago
parent
commit
823009e998
  1. 4
      app/utils/http/factory.ts

4
app/utils/http/factory.ts

@ -8,8 +8,8 @@ export type ApiResponse<T = unknown> = {
}
/** 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<T = unknown> extends Error {
constructor(message: string, public data: T) {
super(message)
this.name = 'ApiError'
}

Loading…
Cancel
Save