UNPKG

caprover-api

Version:
36 lines (35 loc) 1.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class ErrorFactory { constructor() { this.OKAY = 100; this.OKAY_BUILD_STARTED = 101; this.OK_PARTIALLY = 102; this.STATUS_ERROR_GENERIC = 1000; this.STATUS_ERROR_CAPTAIN_NOT_INITIALIZED = 1001; this.STATUS_ERROR_USER_NOT_INITIALIZED = 1101; this.STATUS_ERROR_NOT_AUTHORIZED = 1102; this.STATUS_ERROR_ALREADY_EXIST = 1103; this.STATUS_ERROR_BAD_NAME = 1104; this.STATUS_WRONG_PASSWORD = 1105; this.STATUS_AUTH_TOKEN_INVALID = 1106; this.VERIFICATION_FAILED = 1107; this.ILLEGAL_OPERATION = 1108; this.BUILD_ERROR = 1109; this.ILLEGAL_PARAMETER = 1110; this.NOT_FOUND = 1111; this.AUTHENTICATION_FAILED = 1112; this.STATUS_PASSWORD_BACK_OFF = 1113; this.STATUS_ERROR_OTP_REQUIRED = 1114; this.UNKNOWN_ERROR = 1999; } createError(status, message) { let e = new Error(message || 'null'); e.captainStatus = status; e.captainMessage = message; return e; } } ErrorFactory.STATUS_ERROR_PRO_API_KEY_INVALIDATED = 1115; const errorFactory = new ErrorFactory(); exports.default = errorFactory;