diag(find): log by-ref status+code on every result

This commit is contained in:
Claude VM
2026-05-20 19:09:21 +03:00
parent 52c31e3c4d
commit 18c0eed91e
+15 -2
View File
@@ -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;
}
}