Visualizando todo grafo com anzograph
This commit is contained in:
@@ -43,7 +43,18 @@ export default function App() {
|
||||
|
||||
setStatus("Fetching graph…");
|
||||
const graphRes = await fetch(`/api/graph?graph_query_id=${encodeURIComponent(graphQueryId)}`, { signal });
|
||||
if (!graphRes.ok) throw new Error(`Failed to fetch graph: ${graphRes.status}`);
|
||||
if (!graphRes.ok) {
|
||||
let detail = "";
|
||||
try {
|
||||
const err = await graphRes.json();
|
||||
if (err && typeof err === "object" && typeof (err as any).detail === "string") {
|
||||
detail = (err as any).detail;
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
throw new Error(`Failed to fetch graph: ${graphRes.status}${detail ? ` (${detail})` : ""}`);
|
||||
}
|
||||
const graph = await graphRes.json();
|
||||
if (signal.aborted) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user