Skip to content

Commit

Permalink
fix: ResponseError typescript compile errors
Browse files Browse the repository at this point in the history
this was missing a lot from the javascript class. It should now reflect
what's available in the class. And it should stop typescript compile
errors.
  • Loading branch information
geofflangenderfer committed Aug 17, 2024
1 parent 07b4f71 commit 0bcaefb
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions packages/helpers/classes/response-error.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,34 @@ export default class ResponseError extends Error {
code: number;
message: string;
response: {
headers: { [key: string]: string; };
body: string;
headers: { [key: string]: string };
body: {
errors?: Array<{
message: string;
field: string;
help: string;
}>;
[key: string]: any; // Handle any other properties that might be in the body
};
};

constructor(response: any);

toString(): string;

toJSON(): {
message: string;
code: number;
response: {
headers: { [key: string]: string };
body: {
errors?: Array<{
message: string;
field: string;
help: string;
}>;
[key: string]: any;
};
};
};
}

0 comments on commit 0bcaefb

Please sign in to comment.