UNPKG

thawani-nodejs

Version:

Node.js library for Thawani Payment Gateway

37 lines 1.27 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AuthenticationError = exports.APIError = exports.ValidationError = exports.ThawaniError = void 0; class ThawaniError extends Error { constructor(message, code, type, data) { super(message); this.message = message; this.code = code; this.type = type; this.data = data; this.name = 'ThawaniError'; } } exports.ThawaniError = ThawaniError; class ValidationError extends ThawaniError { constructor(message, data) { super(message, 'validation_error', 'ValidationError', data); this.name = 'ValidationError'; } } exports.ValidationError = ValidationError; class APIError extends ThawaniError { constructor(message, statusCode, code, data) { super(message, code, 'APIError', data); this.statusCode = statusCode; this.name = 'APIError'; } } exports.APIError = APIError; class AuthenticationError extends ThawaniError { constructor(message = 'Authentication failed') { super(message, 'authentication_error', 'AuthenticationError'); this.name = 'AuthenticationError'; } } exports.AuthenticationError = AuthenticationError; //# sourceMappingURL=errors.js.map