diag(find): log by-ref status+code on every result
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user