mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 07:10:16 +08:00
hover show errorMsg when plugin run error
This commit is contained in:
@@ -222,10 +222,7 @@ export function stream(
|
||||
),
|
||||
)
|
||||
.then((res) => {
|
||||
let content = res.data;
|
||||
try {
|
||||
content = JSON.stringify(res.data);
|
||||
} catch (e) {}
|
||||
let content = res.data || res?.statusText;
|
||||
if (res.status >= 300) {
|
||||
return Promise.reject(content);
|
||||
}
|
||||
@@ -240,7 +237,11 @@ export function stream(
|
||||
return content;
|
||||
})
|
||||
.catch((e) => {
|
||||
options?.onAfterTool?.({ ...tool, isError: true });
|
||||
options?.onAfterTool?.({
|
||||
...tool,
|
||||
isError: true,
|
||||
errorMsg: e.toString(),
|
||||
});
|
||||
return e.toString();
|
||||
})
|
||||
.then((content) => ({
|
||||
|
Reference in New Issue
Block a user