Skip to content

Commit

Permalink
Merge pull request #877 from zapier/IQQ-1829-add-missing-error-type
Browse files Browse the repository at this point in the history
chore(types): Add missing ResponseError Type
  • Loading branch information
eliangcs authored Oct 8, 2024
2 parents a70b716 + d0ca325 commit 6d4be1d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions packages/core/types/zapier.custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ declare class RefreshAuthError extends Error {}
declare class ThrottledError extends Error {
constructor(message: string, delay?: number);
}
declare class ResponseError extends Error {
constructor(response: HttpResponse);
}

// copied http stuff from external typings
export interface HttpRequestOptions {
Expand Down Expand Up @@ -135,12 +138,13 @@ type DehydrateFunc = <T>(
export interface ZObject {
request: {
// most specific overloads go first
(url: string, options: HttpRequestOptions & { raw: true }): Promise<
RawHttpResponse
>;
(options: HttpRequestOptions & { raw: true; url: string }): Promise<
RawHttpResponse
>;
(
url: string,
options: HttpRequestOptions & { raw: true }
): Promise<RawHttpResponse>;
(
options: HttpRequestOptions & { raw: true; url: string }
): Promise<RawHttpResponse>;

(url: string, options?: HttpRequestOptions): Promise<HttpResponse>;
(options: HttpRequestOptions & { url: string }): Promise<HttpResponse>;
Expand Down Expand Up @@ -199,6 +203,7 @@ export interface ZObject {
ExpiredAuthError: typeof ExpiredAuthError;
RefreshAuthError: typeof RefreshAuthError;
ThrottledError: typeof ThrottledError;
ResponseError: typeof ResponseError;
};

cache: {
Expand Down

0 comments on commit 6d4be1d

Please sign in to comment.