- Added coverage reporting for Vitest with configuration in vitest.config.mjs - Updated package.json to include new scripts for JS coverage, linting, and formatting - Modified run_quality_gate.py to allow skipping ESLint and Prettier checks - Introduced .prettierrc for consistent code formatting - Created .prettierignore to exclude specific files and directories from formatting
27 lines
751 B
JavaScript
27 lines
751 B
JavaScript
import { APP_CONFIG } from "../app/config.js";
|
|
import { comfyToast } from "../app/toast.js";
|
|
|
|
export function reportError(
|
|
err,
|
|
context = "Majoor",
|
|
{ showToast = false, toastType = "error" } = {},
|
|
) {
|
|
const message = err?.message || String(err || "Unknown error");
|
|
try {
|
|
if (APP_CONFIG.DEBUG_VERBOSE_ERRORS) {
|
|
console.error(`[Majoor][${context}]`, message, err);
|
|
} else {
|
|
console.debug(`[Majoor][${context}]`, message);
|
|
}
|
|
} catch (e) {
|
|
console.debug?.(e);
|
|
}
|
|
if (showToast && APP_CONFIG.DEBUG_VERBOSE_ERRORS) {
|
|
try {
|
|
comfyToast(`${context}: ${message}`, toastType, 4000);
|
|
} catch (e) {
|
|
console.debug?.(e);
|
|
}
|
|
}
|
|
}
|