chore: remove unused code and suppress noisy Claude Code logs
- Delete unused files: retry.js, app-init.js, model-manager.js - Remove duplicate error helpers from helpers.js (exist in errors.js) - Remove unused exports from signature-cache.js, logger.js - Remove unused frontend code: ErrorHandler methods, validators, canDelete, destroy - Make internal functions private in thinking-utils.js - Remove commented-out code from constants.js - Remove deprecated .glass-panel CSS class - Add silent handler for Claude Code event logging (/api/event_logging/batch) - Suppress logging for /v1/messages/count_tokens (501 responses) - Fix catch-all to use originalUrl (wildcard strips req.path) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -46,39 +46,6 @@ window.ErrorHandler.safeAsync = async function(fn, errorMessage = null, options
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Wrap a component method with error handling
|
||||
* @param {Function} method - Method to wrap
|
||||
* @param {string} errorMessage - Error message prefix
|
||||
* @returns {Function} Wrapped method
|
||||
*/
|
||||
window.ErrorHandler.wrapMethod = function(method, errorMessage = null) {
|
||||
return async function(...args) {
|
||||
return window.ErrorHandler.safeAsync(
|
||||
() => method.apply(this, args),
|
||||
errorMessage || Alpine.store('global').t('operationFailed')
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Show a success toast notification
|
||||
* @param {string} message - Success message
|
||||
*/
|
||||
window.ErrorHandler.showSuccess = function(message) {
|
||||
const store = Alpine.store('global');
|
||||
store.showToast(message, 'success');
|
||||
};
|
||||
|
||||
/**
|
||||
* Show an info toast notification
|
||||
* @param {string} message - Info message
|
||||
*/
|
||||
window.ErrorHandler.showInfo = function(message) {
|
||||
const store = Alpine.store('global');
|
||||
store.showToast(message, 'info');
|
||||
};
|
||||
|
||||
/**
|
||||
* Show an error toast notification
|
||||
* @param {string} message - Error message
|
||||
@@ -90,23 +57,6 @@ window.ErrorHandler.showError = function(message, error = null) {
|
||||
store.showToast(fullMessage, 'error');
|
||||
};
|
||||
|
||||
/**
|
||||
* Validate and execute an API call with error handling
|
||||
* @param {Function} apiCall - Async function that makes the API call
|
||||
* @param {string} successMessage - Message to show on success (optional)
|
||||
* @param {string} errorMessage - Message to show on error
|
||||
* @returns {Promise<any>} API response or undefined on error
|
||||
*/
|
||||
window.ErrorHandler.apiCall = async function(apiCall, successMessage = null, errorMessage = 'API call failed') {
|
||||
const result = await window.ErrorHandler.safeAsync(apiCall, errorMessage);
|
||||
|
||||
if (result !== undefined && successMessage) {
|
||||
window.ErrorHandler.showSuccess(successMessage);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Execute an async function with automatic loading state management
|
||||
* @param {Function} asyncFn - Async function to execute
|
||||
|
||||
Reference in New Issue
Block a user