UNPKG

unleash-server

Version:

Unleash is an enterprise ready feature flag service. It provides different strategies for handling feature flags.

18 lines 900 B
import type { ErrorObject } from 'ajv'; import type { ValidationError } from 'joi'; import { type ApiErrorSchema, UnleashError } from './unleash-error.js'; type ValidationErrorDescription = { message: string; path?: string; }; declare class BadDataError extends UnleashError { statusCode: number; details: ValidationErrorDescription[]; constructor(message: string, errors?: [ValidationErrorDescription, ...ValidationErrorDescription[]]); toJSON(): ApiErrorSchema; } export default BadDataError; export declare const fromOpenApiValidationError: (data: object) => (validationError: ErrorObject) => ValidationErrorDescription; export declare const fromOpenApiValidationErrors: (data: object, validationErrors: [ErrorObject, ...ErrorObject[]]) => BadDataError; export declare const fromJoiError: (err: ValidationError) => BadDataError; //# sourceMappingURL=bad-data-error.d.ts.map