Files
2025-12-27 21:16:53 -08:00

24 lines
820 B
TypeScript

/**
* Error list used by {@link BurnerConnectorError}
*/
export const BurnerConnectorErrorList = {
accountNotFound: "Account not found",
couldNotConnect: "Could not connect to network",
unsupportedBurnerChain: "This network is not supported for burner connector",
chainIdNotResolved: "Could not resolve chainId",
chainNotSupported: "Chain is not supported, check burner wallet config",
} as const;
/**
* A union of all the BurnerConnectorErrorList
*/
export type BurnerConnectorErrorTypes = (typeof BurnerConnectorErrorList)[keyof typeof BurnerConnectorErrorList];
export class BurnerConnectorError extends Error {
constructor(errorType: BurnerConnectorErrorTypes, message?: string) {
const msg = `BurnerConnectorError ${errorType}: ${message ?? ""} `;
super(msg);
console.warn(msg);
}
}