Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
195cfd4f
Commit
195cfd4f
authored
Dec 11, 2023
by
Rohit Das
Browse files
wip: displaying error in a toast
parent
a7bec01d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
140 additions
and
120 deletions
+140
-120
src/routes/(app)/+page.svelte
src/routes/(app)/+page.svelte
+70
-60
src/routes/(app)/c/[id]/+page.svelte
src/routes/(app)/c/[id]/+page.svelte
+70
-60
No files found.
src/routes/(app)/+page.svelte
View file @
195cfd4f
...
...
@@ -191,6 +191,15 @@
})
});
if (!res.ok) {
const error = await res.json();
console.log(error);
if ('detail' in error) {
toast.error(error.detail);
} else {
toast.error(error.error);
}
} else {
const reader = res.body
.pipeThrough(new TextDecoderStream())
.pipeThrough(splitStream('\n'))
...
...
@@ -266,6 +275,7 @@
history: history
});
}
}
stopResponseFlag = false;
await tick();
...
...
src/routes/(app)/c/[id]/+page.svelte
View file @
195cfd4f
...
...
@@ -218,6 +218,15 @@
})
});
if (!res.ok) {
const error = await res.json();
console.log(error);
if ('detail' in error) {
toast.error(error.detail);
} else {
toast.error(error.error);
}
} else {
const reader = res.body
.pipeThrough(new TextDecoderStream())
.pipeThrough(splitStream('\n'))
...
...
@@ -293,6 +302,7 @@
history: history
});
}
}
stopResponseFlag = false;
await tick();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment