diff --git a/src/app/api/gis/parcela/find/route.ts b/src/app/api/gis/parcela/find/route.ts index b7248bc..f3114fa 100644 --- a/src/app/api/gis/parcela/find/route.ts +++ b/src/app/api/gis/parcela/find/route.ts @@ -33,16 +33,29 @@ async function tryByRef( layerId, }); console.log( - "[gis-parcela-find] by-ref hit cad=%s siruta=%s", + "[gis-parcela-find] by-ref hit cad=%s siruta=%s layerId=%s", cad, siruta, + layerId, ); return data; } catch (err) { if (err instanceof GisApiError) { - if (err.status === 404) return null; // not deployed yet OR no match — fall back + console.log( + "[gis-parcela-find] by-ref status=%d code=%s cad=%s siruta=%s layerId=%s", + err.status, + err.code, + cad, + siruta, + layerId, + ); + if (err.status === 404) return null; // fall back to search throw err; // propagate 403 / 5xx } + console.error( + "[gis-parcela-find] by-ref non-GisApiError", + err instanceof Error ? err.message : String(err), + ); throw err; } }