Enhance error handling in AIEngine and update ResourceDebugOverlay

- Added error type handling in AIEngine for better error categorization during model configuration and execution.
- Updated _handle_error method to accept and log error types.
- Improved ResourceDebugOverlay to silently ignore 404 responses from the metrics endpoint, preventing unnecessary logging and retries.
- Refactored authStore to utilize fetchAPI for automatic token handling and improved error logging without throwing exceptions.
This commit is contained in:
IGNY8 VPS (Salman)
2025-11-16 11:44:51 +00:00
parent a492eb3560
commit 8908c11c86
3 changed files with 33 additions and 25 deletions

View File

@@ -128,7 +128,7 @@ export default function ResourceDebugOverlay({ enabled }: ResourceDebugOverlayPr
headers['Authorization'] = `Bearer ${token}`;
}
// Silently handle 404s and other errors - metrics might not exist for all requests
// Silently handle 404s and other errors - metrics might not exist for all requests
try {
const response = await nativeFetch.call(window, `${API_BASE_URL}/v1/system/request-metrics/${requestId}/`, {
method: 'GET',
@@ -136,6 +136,11 @@ export default function ResourceDebugOverlay({ enabled }: ResourceDebugOverlayPr
credentials: 'include', // Include session cookies for authentication
});
// Silently ignore 404s - metrics endpoint might not exist for all requests
if (response.status === 404) {
return; // Don't log or retry 404s
}
if (response.ok) {
const responseData = await response.json();
// Extract data from unified API response format: {success: true, data: {...}}