Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

Fix Nominatim User-Agent and improve error diagnostics

Maurice6a19807a72c0
diff --git a/server/src/services/mapsService.ts b/server/src/services/mapsService.ts
index 3229c1b85..50196bf76 100644
--- a/server/src/services/mapsService.ts
+++ b/server/src/services/mapsService.ts
@@ -43,7 +43,7 @@ interface GooglePlaceDetails extends GooglePlaceResult {
// ── Constants ────────────────────────────────────────────────────────────────
-const UA = 'TREK Travel Planner (https://github.com/mauriceboe/NOMAD)';
+const UA = 'TREK Travel Planner (https://github.com/mauriceboe/TREK)';
// ── Photo cache ──────────────────────────────────────────────────────────────
@@ -89,7 +89,10 @@ export async function searchNominatim(query: string, lang?: string) {
const response = await fetch(`https://nominatim.openstreetmap.org/search?${params}`, {
headers: { 'User-Agent': UA },
});
- if (!response.ok) throw new Error('Nominatim API error');
+ if (!response.ok) {
+ const text = await response.text().catch(() => '');
+ throw new Error(`Nominatim API error: ${response.status} ${response.statusText}${text ? ' - ' + text.substring(0, 200) : ''}`);
+ }
const data = await response.json() as NominatimResult[];
return data.map(item => ({
google_place_id: null,