import { Config } from "../app";
import { Error, Sweet } from "../utils";
export class Errors {
    constructor(op, res) {
        this.op = op;
        this.res = res;
    }
    static handle(op, res) {
        if (Config.app_env) {
            console.log('error op', op);
            console.log('error response', res);
        }
        if (res?.noUpdate) {
            Sweet.success({ html: res?.title });
        }
        if (res?.bigError) {
            Error.validateErrors(res.errors);
        }
        if (res?.wrong) {
            Sweet.error({ html: res?.title });
        }
        return this;
    }
}
//# sourceMappingURL=errors.js.map