UNPKG

@unstoppabledomains/resolution

Version:
34 lines (33 loc) 1.48 kB
import { ResolutionMethod } from '../types/publicTypes'; /** Explains Resolution Error options */ declare type ConfigurationErrorOptions = { method?: ResolutionMethod; dependency?: string; config?: string; field?: string; version?: string; }; export declare enum ConfigurationErrorCode { IncorrectProvider = "IncorrectProvider", UnsupportedNetwork = "UnsupportedNetwork", UnspecifiedUrl = "UnspecifiedUrl", NetworkConfigMissing = "NetworkConfigMissing", CustomNetworkConfigMissing = "CustomNetworkConfigMissing", InvalidConfigurationField = "InvalidProxyReader", DependencyMissing = "DependencyMissing" } /** * Configuration Error class is designed to control every error being thrown by wrong configurations for objects * @param code - Error Code * - IncorrectProvider - When provider doesn't have implemented send or sendAsync methods * - UnsupportedNetwork - When network is not specified or not supported * - UnspecifiedUrl - When url is not specified for custom naming service configurations * - CustomNetworkConfigMissing - When configuration is missing for custom network configurations * @param method - optional param to specify which namingService errored out */ export declare class ConfigurationError extends Error { readonly code: ConfigurationErrorCode; readonly method?: string; constructor(code: ConfigurationErrorCode, options?: ConfigurationErrorOptions); } export default ConfigurationError;