Skip to content

Commit

Permalink
ViemError -> AccountAbstractionError
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler committed Apr 8, 2024
1 parent 60e6efc commit d987770
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/common/src/utils/Helpers/getAAError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ const buildErrorStrings = (error: KnownError, service?: Service): string[] =>
service ? `\nSent via: ${service}` : "",
].filter(Boolean);


Check failure on line 29 in packages/common/src/utils/Helpers/getAAError.ts

View workflow job for this annotation

GitHub Actions / Lint sources (18.x)

Replace `⏎type·AccountAbstractionErrorParams·=·{·docsSlug?:·string;·metaMessages?:·string[];·details?:·string·}` with `type·AccountAbstractionErrorParams·=·{·docsSlug?:·string;·metaMessages?:·string[];·details?:·string·};`
type AccountAbstractionErrorParams = { docsSlug?: string; metaMessages?: string[]; details?: string }

class AccountAbstractionError extends BaseError {
override name = "AccountAbstractionError";
constructor(title: string, params: AccountAbstractionErrorParams = {}) {

Check failure on line 34 in packages/common/src/utils/Helpers/getAAError.ts

View workflow job for this annotation

GitHub Actions / Lint sources (18.x)

Expected blank line between class members
super(title, params);
}
}

export const getAAError = async (message: string, service?: Service) => {
if (!knownErrors.length) {
const errors = (await (await fetch(ERRORS_URL)).json()) as KnownError[];
Expand All @@ -37,5 +47,5 @@ export const getAAError = async (message: string, service?: Service) => {
const title = matchedError ? matchedError.name : "Unknown Error";
const docsSlug = matchedError?.docsUrl ?? DOCS_URL;

return new BaseError(title, { docsSlug, metaMessages, details });
return new AccountAbstractionError(title, { docsSlug, metaMessages, details });
};

0 comments on commit d987770

Please sign in to comment.