UNPKG

@snap/camera-kit

Version:
29 lines 1.48 kB
function cleanErrorStack(stack) { const [first, _, ...rest] = stack.split("\n"); return [first, ...rest].join("\n"); } export function namedError(name) { return (message, cause) => { const error = new Error(message, { cause }); error.name = name; error.stack = error.stack && cleanErrorStack(error.stack); return error; }; } export const legalError = namedError("LegalError"); export const lensContentValidationError = namedError("LensContentValidationError"); export const lensError = namedError("LensError"); export const cameraKitSourceError = namedError("CameraKitSourceError"); export const lensImagePickerError = namedError("LensImagePickerError"); export const cacheKeyNotFoundError = namedError("CacheKeyNotFoundError"); export const configurationError = namedError("ConfigurationError"); export const webGLError = namedError("WebGLError"); export const benchmarkError = namedError("BenchmarkError"); export const platformNotSupportedError = namedError("PlatformNotSupportedError"); export const lensExecutionError = namedError("LensExecutionError"); export const lensAbortError = namedError("LensAbortError"); export const persistentStoreError = namedError("PersistentStoreError"); export const lensAssetError = namedError("LensAssetError"); export const bootstrapError = namedError("BootstrapError"); export const argumentValidationError = namedError("ArgumentValidationError"); //# sourceMappingURL=namedErrors.js.map