-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Chore(handler): add error handler
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * as Service from "./service"; | ||
export * as Wallet from "./wallet"; | ||
export * as ZarbanUtils from "./utils"; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ModelError as WalletModelError, UserError as WalletUserError } from "../wallet"; | ||
import { ModelError as ServiceModelError, UserError as ServiceUserError } from "../service"; | ||
import type { AxiosResponse } from "axios"; | ||
type AsyncFn<T> = (...args: any[]) => Promise<T>; | ||
type SuccessCallback<T> = (result: T) => void; | ||
export declare function isOfType<T>(obj: any, keys: (keyof T)[]): obj is T; | ||
type ErrorTypes = Error | ServiceModelError | WalletModelError | ServiceUserError | WalletUserError; | ||
export declare function withErrorHandler<T>(sdkName: "Service" | "Wallet", fn: AsyncFn<AxiosResponse<T>>, onSuccess?: SuccessCallback<AxiosResponse<T>>): (...args: Parameters<typeof fn>) => Promise<[T | null, ErrorTypes | null]>; | ||
export {}; | ||
//# sourceMappingURL=errorHandler.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./errorHandler"; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * as Service from "./service"; | ||
export * as Wallet from "./wallet"; | ||
export * as ZarbanUtils from "./utils"; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ModelError as WalletModelError, UserError as WalletUserError } from "../wallet"; | ||
import { ModelError as ServiceModelError, UserError as ServiceUserError } from "../service"; | ||
import type { AxiosResponse } from "axios"; | ||
type AsyncFn<T> = (...args: any[]) => Promise<T>; | ||
type SuccessCallback<T> = (result: T) => void; | ||
export declare function isOfType<T>(obj: any, keys: (keyof T)[]): obj is T; | ||
type ErrorTypes = Error | ServiceModelError | WalletModelError | ServiceUserError | WalletUserError; | ||
export declare function withErrorHandler<T>(sdkName: "Service" | "Wallet", fn: AsyncFn<AxiosResponse<T>>, onSuccess?: SuccessCallback<AxiosResponse<T>>): (...args: Parameters<typeof fn>) => Promise<[T | null, ErrorTypes | null]>; | ||
export {}; | ||
//# sourceMappingURL=errorHandler.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.