UNPKG

@kameleoon/javascript-sdk-core

Version:
29 lines (28 loc) 2.37 kB
import { KameleoonStorageKey } from '../storage'; import { TargetingType } from '../targeting'; import { KameleoonException } from './types'; /** * @class * KameleoonError - extends standard `Error` by adding custom `type` property with the type of `KameleoonException` * */ export declare class KameleoonError extends Error { private errorType; /** * @param {KameleoonException} type - type of KameleoonError represented by `KameleoonException` enum * */ constructor(type: KameleoonException.Initialization | KameleoonException.Credentials | KameleoonException.VisitorCodeMaxLength | KameleoonException.VisitorCodeEmpty | KameleoonException.VisitAmount | KameleoonException.StorageInitialization | KameleoonException.EventSourceInitialization | KameleoonException.StorageEmpty); constructor(type: KameleoonException.FeatureFlagConfigurationNotFound | KameleoonException.FeatureFlagEnvironmentDisabled, featureKey: string); constructor(type: KameleoonException.FeatureFlagConfigurationNotFound | KameleoonException.FeatureFlagEnvironmentDisabled, featureKey: string, environment: string); constructor(type: KameleoonException.FeatureFlagVariableNotFound, variableKey: string, visitorCode: string); constructor(type: KameleoonException.FeatureFlagVariationNotFound, variationKey: string, visitorCode: string); constructor(type: KameleoonException.FeatureFlagExperimentNotFound, experimentId: number, visitorCode: string); constructor(type: KameleoonException.CookieParse, message: string); constructor(type: KameleoonException.StorageWrite | KameleoonException.JSONParse | KameleoonException.RemoteData | KameleoonException.MaximumRetriesReached | KameleoonException.ClientConfiguration, err: unknown); constructor(type: KameleoonException.StorageRead, storageKey: string); constructor(type: KameleoonException.StorageParse, err: unknown, key: KameleoonStorageKey); constructor(type: KameleoonException.TargetingCondition, targetingType: TargetingType); constructor(type: KameleoonException.AmongValuesCheck, err: unknown, value: string); constructor(type: KameleoonException.RangeCheck, value?: number[] | null); constructor(type: KameleoonException.NumberParse | KameleoonException.VersionParse | KameleoonException.SemanticVersionParse, value: string); get type(): KameleoonException; }