12 行
346 B
TypeScript
12 行
346 B
TypeScript
|
|
export class RequestError<TData = unknown> extends Error {
|
||
|
|
constructor(
|
||
|
|
message: string,
|
||
|
|
public readonly type: 'Cancel' | 'ValidationError' | 'AxiosError' | 'OtherError',
|
||
|
|
public readonly cause?: unknown,
|
||
|
|
public readonly response?: { data?: TData; status?: number },
|
||
|
|
) {
|
||
|
|
super(message)
|
||
|
|
this.name = 'RequestError'
|
||
|
|
}
|
||
|
|
}
|