ccashfrontend/views/node_modules/ccash-client-js/dist/CCashClient.exceptions.js
2021-06-18 09:20:09 +10:00

63 lines
2.5 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExceptionMap = exports.ErrorCodes = exports.InsufficientFundsException = exports.UserAlreadyExistsException = exports.NameTooLongException = exports.InvalidRequestException = exports.WrongPasswordException = exports.UserNotFoundException = exports.BaseUrlMissingException = void 0;
const Exception_1 = require("./Exception");
class BaseUrlMissingException extends Exception_1.Exception {
constructor() {
super('base url missing');
}
}
exports.BaseUrlMissingException = BaseUrlMissingException;
class UserNotFoundException extends Exception_1.Exception {
constructor() {
super('user not found');
}
}
exports.UserNotFoundException = UserNotFoundException;
class WrongPasswordException extends Exception_1.Exception {
constructor() {
super('wrong password');
}
}
exports.WrongPasswordException = WrongPasswordException;
class InvalidRequestException extends Exception_1.Exception {
constructor() {
super('invalid request');
}
}
exports.InvalidRequestException = InvalidRequestException;
class NameTooLongException extends Exception_1.Exception {
constructor() {
super('name too long');
}
}
exports.NameTooLongException = NameTooLongException;
class UserAlreadyExistsException extends Exception_1.Exception {
constructor() {
super('user already exists');
}
}
exports.UserAlreadyExistsException = UserAlreadyExistsException;
class InsufficientFundsException extends Exception_1.Exception {
constructor() {
super('insufficient funds');
}
}
exports.InsufficientFundsException = InsufficientFundsException;
var ErrorCodes;
(function (ErrorCodes) {
ErrorCodes[ErrorCodes["UserNotFound"] = -1] = "UserNotFound";
ErrorCodes[ErrorCodes["WrongPassword"] = -2] = "WrongPassword";
ErrorCodes[ErrorCodes["InvalidRequest"] = -3] = "InvalidRequest";
ErrorCodes[ErrorCodes["NameTooLong"] = -5] = "NameTooLong";
ErrorCodes[ErrorCodes["UserAlreadyExists"] = -6] = "UserAlreadyExists";
ErrorCodes[ErrorCodes["InsufficientFunds"] = -7] = "InsufficientFunds";
})(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {}));
exports.ExceptionMap = {
[ErrorCodes.UserNotFound]: UserNotFoundException,
[ErrorCodes.WrongPassword]: WrongPasswordException,
[ErrorCodes.InvalidRequest]: InvalidRequestException,
[ErrorCodes.NameTooLong]: NameTooLongException,
[ErrorCodes.UserAlreadyExists]: UserAlreadyExistsException,
[ErrorCodes.InsufficientFunds]: InsufficientFundsException,
};