Refactor: Implement logging phases

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 17:08:36 +00:00
parent 12de4e2ec1
commit b6179372e6
27 changed files with 72 additions and 45 deletions

View File

@@ -102,7 +102,7 @@ export function LocationSearch({ onLocationSelect, initialLocationId, className
// Check if response is OK and content-type is JSON
if (!response.ok) {
const errorMsg = `Location search failed (${response.status}). Please try again.`;
console.error('OpenStreetMap API error:', response.status);
logger.error('OpenStreetMap API error', { status: response.status });
setSearchError(errorMsg);
setResults([]);
setShowResults(false);
@@ -112,7 +112,7 @@ export function LocationSearch({ onLocationSelect, initialLocationId, className
const contentType = response.headers.get('content-type');
if (!contentType || !contentType.includes('application/json')) {
const errorMsg = 'Invalid response from location service. Please try again.';
console.error('Invalid response format from OpenStreetMap');
logger.error('Invalid response format from OpenStreetMap', { contentType });
setSearchError(errorMsg);
setResults([]);
setShowResults(false);