Spaces:
Running
Running
fix: extract string from rate-limit error object to prevent React crash
Browse files
bioai-platform/frontend/src/app/(dashboard)/analyze/admet/page.tsx
CHANGED
|
@@ -32,7 +32,7 @@ export default function ADMETPage() {
|
|
| 32 |
const res = await computeADMET(smiles.trim());
|
| 33 |
setResult(res.result);
|
| 34 |
} catch (e: any) {
|
| 35 |
-
setError(e?.response?.data?.detail || e.message || "Computation failed");
|
| 36 |
} finally {
|
| 37 |
setLoading(false);
|
| 38 |
}
|
|
|
|
| 32 |
const res = await computeADMET(smiles.trim());
|
| 33 |
setResult(res.result);
|
| 34 |
} catch (e: any) {
|
| 35 |
+
setError(typeof e?.response?.data?.detail === "string" ? e.response.data.detail : e?.response?.data?.detail?.message || e.message || "Computation failed");
|
| 36 |
} finally {
|
| 37 |
setLoading(false);
|
| 38 |
}
|
bioai-platform/frontend/src/app/(dashboard)/analyze/function/page.tsx
CHANGED
|
@@ -56,7 +56,7 @@ export default function FunctionPage() {
|
|
| 56 |
setJobId(res.job_id);
|
| 57 |
setStatus(res.status);
|
| 58 |
} catch (e: any) {
|
| 59 |
-
setError(e?.response?.data?.detail || e.message || "Submission failed");
|
| 60 |
setLoading(false);
|
| 61 |
}
|
| 62 |
};
|
|
|
|
| 56 |
setJobId(res.job_id);
|
| 57 |
setStatus(res.status);
|
| 58 |
} catch (e: any) {
|
| 59 |
+
setError(typeof e?.response?.data?.detail === "string" ? e.response.data.detail : e?.response?.data?.detail?.message || e.message || "Submission failed");
|
| 60 |
setLoading(false);
|
| 61 |
}
|
| 62 |
};
|
bioai-platform/frontend/src/app/(dashboard)/analyze/md/page.tsx
CHANGED
|
@@ -57,7 +57,7 @@ export default function MDPage() {
|
|
| 57 |
setJobId(res.job_id);
|
| 58 |
setStatus(res.status);
|
| 59 |
} catch (e: any) {
|
| 60 |
-
setError(e?.response?.data?.detail || e.message || "Submission failed");
|
| 61 |
setLoading(false);
|
| 62 |
}
|
| 63 |
};
|
|
|
|
| 57 |
setJobId(res.job_id);
|
| 58 |
setStatus(res.status);
|
| 59 |
} catch (e: any) {
|
| 60 |
+
setError(typeof e?.response?.data?.detail === "string" ? e.response.data.detail : e?.response?.data?.detail?.message || e.message || "Submission failed");
|
| 61 |
setLoading(false);
|
| 62 |
}
|
| 63 |
};
|