mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 20:31:12 -05:00
Refactor: Implement logging phases
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user