fix(frontend): show backend error detail on project upload failure (#12791)

* fix(frontend): read backend error detail on project upload failure

Backend returns error payload under `detail` (FastAPI convention), but
the upload handler was reading `message`, producing an empty alert list.
Switch to `detail` with `message` and raw-error fallbacks, typed via
AxiosError.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(frontend): simplify project upload error handler

Revert defensive AxiosError typing; keep direct `detail` read which is
sufficient for the upload error path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(frontend): guard upload error handler against missing response

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
keval shah
2026-04-20 14:05:43 -04:00
committed by GitHub
parent 16432b61f2
commit 8db793435e

View File

@ -168,7 +168,10 @@ const SideBarFoldersButtonsComponent = ({
console.error(err);
setErrorData({
title: t("sidebar.projectUploadError"),
list: [err["response"]["data"]["message"]],
list: [
err?.response?.data?.detail ??
(err instanceof Error ? err.message : String(err)),
],
});
},
},