@bugspotter/sdk
Version:
Professional bug reporting SDK with screenshots, session replay, and automatic error capture for web applications
24 lines (23 loc) • 735 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseCapture = void 0;
const logger_1 = require("../utils/logger");
const logger = (0, logger_1.getLogger)();
/**
* Base class for all capture implementations
* Provides common functionality like error handling and sanitization
*/
class BaseCapture {
constructor(options) {
this.options = options;
this.sanitizer = options.sanitizer;
}
/**
* Log an error that occurred during capture
*/
handleError(context, error) {
const err = error instanceof Error ? error : new Error(String(error));
logger.error(`${this.constructor.name} ${context}:`, err);
}
}
exports.BaseCapture = BaseCapture;