fix: handle duplicate security names and non-JSON error responses
Build Service / build (push) Canceled after 0s

- Disambiguate duplicate (company, security) pairs in Carta exports:
  e.g. two 'Warrants' under BIP21 become 'Warrants' and 'Warrants (2)'
- Tested against Fund II: 33 holdings, 41 positions (3 companies with
  duplicate tranches), zero errors
- Frontend: graceful handling of 500 responses (shows status code
  instead of JSON parse crash)
This commit is contained in:
Johnny 5
2026-06-08 03:20:37 +00:00
parent 30d2284feb
commit 758fac3ab5
2 changed files with 20 additions and 2 deletions
+8 -1
View File
@@ -66,7 +66,14 @@ export default function Import() {
}
const res = await fetch(url, { method: "POST", body: form });
const data = await res.json();
let data: any;
try {
data = await res.json();
} catch {
setError(`Server error (${res.status}). Check file format and try again.`);
setLoading(false);
return;
}
if (!res.ok) {
setError(data.detail || "Import failed");
} else {