UNPKG

web3-error-helper

Version:

> 🛠️ Turn confusing Web3 errors into clear, human-friendly messages for developers and users alike.

22 lines (21 loc) 804 B
/** * Error type detection utilities * * This module provides intelligent error type classification based on * error message content. It uses keyword matching to automatically * categorize errors into specific types (wallet, network, contract, etc.) * for better fallback message selection and error handling. */ import { ErrorType } from '../types'; /** * Detect error type based on error message keywords */ export declare function detectErrorType(errorMessage: string): ErrorType | null; /** * Check if error message contains specific error type keywords */ export declare function isErrorType(errorMessage: string, errorType: ErrorType): boolean; /** * Get all error types that match the error message */ export declare function getMatchingErrorTypes(errorMessage: string): ErrorType[];