mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 21:43:07 +00:00
chore: add pre-built dist folder for npx usage
This commit is contained in:
committed by
Romuald Członkowski
parent
a70d96a373
commit
5057481e70
45
dist/telemetry/error-sanitizer.js
vendored
Normal file
45
dist/telemetry/error-sanitizer.js
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.extractErrorMessage = extractErrorMessage;
|
||||
exports.sanitizeStartupError = sanitizeStartupError;
|
||||
exports.processStartupError = processStartupError;
|
||||
const logger_1 = require("../utils/logger");
|
||||
const error_sanitization_utils_1 = require("./error-sanitization-utils");
|
||||
function extractErrorMessage(error) {
|
||||
try {
|
||||
if (error instanceof Error) {
|
||||
return error.stack || error.message || 'Unknown error';
|
||||
}
|
||||
if (typeof error === 'string') {
|
||||
return error;
|
||||
}
|
||||
if (error && typeof error === 'object') {
|
||||
const errorObj = error;
|
||||
if (errorObj.message) {
|
||||
return String(errorObj.message);
|
||||
}
|
||||
if (errorObj.error) {
|
||||
return String(errorObj.error);
|
||||
}
|
||||
try {
|
||||
return JSON.stringify(error).substring(0, 500);
|
||||
}
|
||||
catch {
|
||||
return 'Error object (unstringifiable)';
|
||||
}
|
||||
}
|
||||
return String(error);
|
||||
}
|
||||
catch (extractError) {
|
||||
logger_1.logger.debug('Error during message extraction:', extractError);
|
||||
return 'Error message extraction failed';
|
||||
}
|
||||
}
|
||||
function sanitizeStartupError(errorMessage) {
|
||||
return (0, error_sanitization_utils_1.sanitizeErrorMessageCore)(errorMessage);
|
||||
}
|
||||
function processStartupError(error) {
|
||||
const message = extractErrorMessage(error);
|
||||
return sanitizeStartupError(message);
|
||||
}
|
||||
//# sourceMappingURL=error-sanitizer.js.map
|
||||
Reference in New Issue
Block a user