mirror of
https://github.com/strapi/strapi.git
synced 2025-07-29 11:58:29 +00:00

Co-authored-by: Fernando Chávez <fc9chavez@gmail.com> Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com> Co-authored-by: markkaylor <mark.kaylor@strapi.io> Co-authored-by: Mark Kaylor <mark.kaylor@strapi.io> Co-authored-by: Madhuri Sandbhor <madhurisandbhor@gmail.com> Co-authored-by: Jackson Hammond <malts18@gmail.com> Co-authored-by: yurimutti <muttiyuri@gmail.com> Co-authored-by: Fernando Chávez <fernando.chavez@strapi.io> Co-authored-by: GJunior <samaritanojr006@gmail.com> Co-authored-by: Milan K <57148574+mkcy3@users.noreply.github.com> Co-authored-by: Rémi de Juvigny <remi.dejuvigny@strapi.io> Co-authored-by: boris.shulyak <borysshulyak@gmail.com> Co-authored-by: Alec Winter <34278963+nolliebigspin@users.noreply.github.com> Co-authored-by: Boris Shulyak <55171497+BorysShulyak@users.noreply.github.com> Co-authored-by: 0xATHERIS <ath3ris@proton.me> Co-authored-by: Andrew <112592168+fletch-r@users.noreply.github.com> Co-authored-by: Rémi de Juvigny <8087692+remidej@users.noreply.github.com> Co-authored-by: Dallas Clark <542948+dallasclark@users.noreply.github.com> Co-authored-by: Okorare Tega <contact@tegacreatives.com> Co-authored-by: Júlíus Guðni <julius@extis.one> Co-authored-by: Simone <startae14@gmail.com>
51 lines
1.7 KiB
TypeScript
51 lines
1.7 KiB
TypeScript
// temporary solution found from https://stackoverflow.com/a/41641001/10434847
|
|
|
|
import { ValidationError as ActualYupValidationError } from 'yup';
|
|
|
|
export namespace errors {
|
|
export declare class ApplicationError<TDetails = unknown> extends Error {
|
|
details: TDetails;
|
|
|
|
constructor(message?: string, details?: TDetails);
|
|
}
|
|
|
|
export declare class ValidationError<TDetails = unknown> extends ApplicationError<TDetails> {
|
|
constructor(message?: string, details?: unknown);
|
|
}
|
|
|
|
export interface YupFormattedError {
|
|
path: string[];
|
|
message: string;
|
|
name: string;
|
|
}
|
|
export declare class YupValidationError extends ValidationError<{
|
|
errors: Array<YupFormattedError>;
|
|
}> {
|
|
constructor(yupError: ActualYupValidationError, message?: string);
|
|
}
|
|
export declare class PaginationError extends ApplicationError {
|
|
constructor(message?: string, details?: unknown);
|
|
}
|
|
export declare class NotFoundError extends ApplicationError {
|
|
constructor(message?: string, details?: unknown);
|
|
}
|
|
export declare class ForbiddenError extends ApplicationError {
|
|
constructor(message?: string, details?: unknown);
|
|
}
|
|
export declare class UnauthorizedError extends ApplicationError {
|
|
constructor(message?: string, details?: unknown);
|
|
}
|
|
export declare class RateLimitError extends ApplicationError {
|
|
constructor(message?: string, details?: unknown);
|
|
}
|
|
export declare class PayloadTooLargeError extends ApplicationError {
|
|
constructor(message?: string, details?: unknown);
|
|
}
|
|
export declare class PolicyError extends ForbiddenError {
|
|
constructor(message?: string, details?: unknown);
|
|
}
|
|
export declare class NotImplementedError extends ApplicationError {
|
|
constructor(message?: string, details?: unknown);
|
|
}
|
|
}
|