Imrpove error handling
Browse files
src/lib/components/InferencePlayground/InferencePlayground.svelte
CHANGED
@@ -114,9 +114,15 @@
|
|
114 |
if (streamingMsgAdded) {
|
115 |
conversation.messages = conversation.messages.slice(0, -1);
|
116 |
}
|
117 |
-
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
}
|
121 |
} finally {
|
122 |
loading = false;
|
|
|
114 |
if (streamingMsgAdded) {
|
115 |
conversation.messages = conversation.messages.slice(0, -1);
|
116 |
}
|
117 |
+
if (error instanceof Error) {
|
118 |
+
if (error.message.includes("token seems invalid")) {
|
119 |
+
hfToken = "";
|
120 |
+
}
|
121 |
+
if (error.name !== "AbortError") {
|
122 |
+
alert("error: " + error.message);
|
123 |
+
}
|
124 |
+
} else {
|
125 |
+
alert("An unknown error occurred");
|
126 |
}
|
127 |
} finally {
|
128 |
loading = false;
|