- Added DuplicatesService for background duplicate analysis and similarity detection. - Introduced endpoints for analyzing duplicates, checking status, and merging tags. - Created utility functions for file hashing and perceptual hashing. - Implemented watcher settings for runtime tuning of debounce and deduplication. - Added database maintenance tools for resetting and deleting the database. - Enhanced error handling with sanitization for client responses. - Added tests for duplicates service and error handling. - Updated ESLint configuration for better code quality checks. - Introduced filename validation and logging utilities.
19 lines
654 B
JavaScript
19 lines
654 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 {}
|
|
if (showToast && APP_CONFIG.DEBUG_VERBOSE_ERRORS) {
|
|
try {
|
|
comfyToast(`${context}: ${message}`, toastType, 4000);
|
|
} catch {}
|
|
}
|
|
}
|