Skip to content

Commit

Permalink
Refactor error handling in TestView component
Browse files Browse the repository at this point in the history
  • Loading branch information
mmabrouk committed Jan 24, 2024
1 parent a0079e2 commit 5090c79
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions agenta-web/src/components/Playground/Views/TestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,12 @@ const App: React.FC<TestViewProps> = ({
return newDataList
})
}
} catch (e) {
} catch (e: any) {
if (!controller.signal.aborted) {
setResultForIndex(`❌ ${getErrorMessage(e)}`, index)
setResultForIndex(
`❌ ${getErrorMessage(e?.response?.data?.error || e?.response?.data, e)}`,
index,
)
} else {
setResultForIndex("", index)
setAdditionalDataList((prev) => {
Expand Down

0 comments on commit 5090c79

Please sign in to comment.