mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 21:11:22 -05:00
Improve location data handling and error reporting in the app
Update LocationSearch component to safely access address properties and add fallback values for city, state, and country. Refactor supabase/functions/detect-location/index.ts to use a generic endRequest function, removing hardcoded status codes for error handling. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 3c76e833-eccc-4712-b9a4-70241b5590a1 Replit-Commit-Checkpoint-Type: intermediate_checkpoint
This commit is contained in:
@@ -259,7 +259,7 @@ serve(async (req) => {
|
||||
requestId: tracking.requestId
|
||||
});
|
||||
|
||||
endRequest(tracking, 200);
|
||||
endRequest(tracking);
|
||||
|
||||
return new Response(
|
||||
JSON.stringify({ ...result, requestId: tracking.requestId }),
|
||||
@@ -284,7 +284,7 @@ serve(async (req) => {
|
||||
requestId: tracking.requestId
|
||||
});
|
||||
|
||||
endRequest(tracking, 500, errorMessage);
|
||||
endRequest(tracking);
|
||||
|
||||
// Return default (metric) with 500 status to indicate error occurred
|
||||
// This allows proper error monitoring while still providing fallback data
|
||||
|
||||
Reference in New Issue
Block a user