Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

Commit 34d5a0a

Browse files
authored
Pipe through the error message if there is one from the prompt form (#237)
1 parent 9cf1fff commit 34d5a0a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/PromptForm.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@
3737
})
3838
3939
if (!response.ok) {
40-
error = 'Failed to submit prompt'
40+
const errorBody = await response.json()
41+
if (errorBody && typeof errorBody === 'object' && 'message' in errorBody) {
42+
error = errorBody.message
43+
} else {
44+
error = 'Failed to submit prompt'
45+
}
4146
return
4247
}
4348

0 commit comments

Comments
 (0)