Skip to content

Commit

Permalink
feat: XiorError support generic type
Browse files Browse the repository at this point in the history
  • Loading branch information
suhaotian committed Apr 24, 2024
1 parent 57205fe commit ec52c05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ export function joinPath(path1: string, path2: string) {
return (path1.endsWith('/') ? path1 : path1 + '/') + (path2[0] === '/' ? path2.slice(1) : path2);
}

export class XiorError extends Error {
export class XiorError<T = any> extends Error {
request?: XiorRequestConfig;
config?: XiorRequestConfig;
response?: XiorResponse;

constructor(message: string, request?: XiorRequestConfig, response?: XiorResponse) {
constructor(message: string, request?: XiorRequestConfig, response?: XiorResponse<T>) {
super(message);
this.name = 'XiorError';
this.request = request;
Expand Down

0 comments on commit ec52c05

Please sign in to comment.