export class ValidationError extends Error {
    public status = 400;
    public errors: {
        formErrors: string[];
        fieldErrors: Record<string, string[]>;
    };

    constructor(fieldErrors: Record<string, string[]>, formErrors: string[] = []) {
        super("Validation error");

        this.errors = {
            formErrors,
            fieldErrors
        };
    }
}