@curiosity/niubiz
Version:
niubiz module for nodejs
63 lines (60 loc) • 2.02 kB
JavaScript
/**
* Excepción para errores al crear el token de seguridad
*
* @param {string} type error o exception
* @param {string} status Codigo de estado HTTP
* @param {string} message Mensaje de error del servidor *solo cuando type es exception
* @param {object | null} error Informacion del error *solo cuando type es error
*
*
*/
exports.NiubizExceptionSecurityToken = function (type, status, message, error) {
this.type = type;
this.code = 1,
this.status = status;
this.mensaje = message;
this.error = error;
this.toString = function() {
return `(${this.code})[${this.type}] ${this.mensaje}`;
};
};
/**
* Excepción para errores al crear la sesion de comunicación
*
* @param {string} type error o exception
* @param {string} status Codigo de estado HTTP
* @param {string} message Mensaje de error del servidor *solo cuando type es exception
* @param {object | null} error Informacion del error *solo cuando type es error
*
*
*/
exports.NiubizExceptionComunicationSession = function (type, status, message, error) {
this.type = type;
this.code = 2,
this.status = status;
this.mensaje = message;
this.error = error;
this.toString = function() {
return `(${this.code})[${this.type}] ${this.mensaje}`;
};
};
/**
* Excepción para identificadores errores al consultar la autorizacion del pago
*
* @param {string} type error o exception
* @param {string} status Codigo de estado HTTP
* @param {string} message Mensaje de error del servidor *solo cuando type es exception
* @param {object | null} error Informacion del error *solo cuando type es error
*
*
*/
exports.NiubizExceptionAuthorization = function (type, status, message, error) {
this.type = type;
this.code = 4,
this.status = status;
this.mensaje = message;
this.error = error;
this.toString = function() {
return `(${this.code})[${this.type}] ${this.mensaje}`;
};
};