UNPKG

modify-qris

Version:

Modify QRIS Generator is a javascript based libraries that enabling flexible payments with customizable amounts for improved efficiency and user experience

40 lines (39 loc) 1.16 kB
"use strict"; /** * QRIS error types for handling different types of errors */ Object.defineProperty(exports, "__esModule", { value: true }); exports.QRISParseError = exports.QRISError = void 0; /** * Base QRIS error class */ class QRISError extends Error { constructor(message, code, details) { super(message); this.name = 'QRISError'; this.code = code; this.details = details; // Ensure stack trace works properly for custom errors in V8 if (Error.captureStackTrace) { Error.captureStackTrace(this, QRISError); } } } exports.QRISError = QRISError; /** * Error class specifically for QRIS parsing issues */ class QRISParseError extends Error { constructor(message, tag, position, rawData) { super(message); this.name = 'QRISParseError'; this.tag = tag; this.position = position; this.rawData = rawData; // Ensure stack trace works properly for custom errors in V8 if (Error.captureStackTrace) { Error.captureStackTrace(this, QRISParseError); } } } exports.QRISParseError = QRISParseError;