Skip to content

Commit 4b2e959

Browse files
Bold Create AgentVinothSF5015
andcommitted
Show server upload error detail in UI
Co-authored-by: VinothSF5015 <197725877+VinothSF5015@users.noreply.github.com>
1 parent 68a68e8 commit 4b2e959

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • Document_Chunking1_New/AgentRAGWithAzure 1/AgentRAGWithAzure/wwwroot/js

‎Document_Chunking1_New/AgentRAGWithAzure 1/AgentRAGWithAzure/wwwroot/js/workspace.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ async function uploadFiles() {
246246
if (!response.ok) {
247247
const err = new Error("upload");
248248
err.status = response.status;
249+
err.detail = payload && payload.error;
249250
throw err;
250251
}
251252
const added = payload.files || accepted.map(function (f) { return f.name; });
@@ -258,7 +259,8 @@ async function uploadFiles() {
258259
renderSelected([]);
259260
await refreshReadyState();
260261
} catch (error) {
261-
setLive(status, friendlyError(error, "Could not prepare these documents. Try adding them again."), "error");
262+
const fallback = friendlyError(error, "Could not prepare these documents. Try adding them again.");
263+
setLive(status, error && error.detail ? fallback + " " + error.detail : fallback, "error");
262264
uploadButton.disabled = accepted.length === 0;
263265
} finally {
264266
progress.classList.remove("is-active");

0 commit comments

Comments
 (0)