forked from prehistoric-systems/chatpad
display original error from openai
This commit is contained in:
parent
881ba95664
commit
61f073d0e2
4 changed files with 16 additions and 8 deletions
|
|
@ -51,11 +51,13 @@ export function CreatePromptModal({ content }: { content?: string }) {
|
|||
color: "red",
|
||||
message: "No internet connection.",
|
||||
});
|
||||
} else {
|
||||
}
|
||||
const message = error.response?.data?.error?.message;
|
||||
if (message) {
|
||||
notifications.show({
|
||||
title: "Error",
|
||||
color: "red",
|
||||
message: "Your OpenAI Key is invalid.",
|
||||
message,
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -43,11 +43,13 @@ export function EditChatModal({
|
|||
color: "red",
|
||||
message: "No internet connection.",
|
||||
});
|
||||
} else {
|
||||
}
|
||||
const message = error.response?.data?.error?.message;
|
||||
if (message) {
|
||||
notifications.show({
|
||||
title: "Error",
|
||||
color: "red",
|
||||
message: "Your OpenAI Key is invalid.",
|
||||
message,
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -47,11 +47,13 @@ export function EditPromptModal({ prompt }: { prompt: Prompt }) {
|
|||
color: "red",
|
||||
message: "No internet connection.",
|
||||
});
|
||||
} else {
|
||||
}
|
||||
const message = error.response?.data?.error?.message;
|
||||
if (message) {
|
||||
notifications.show({
|
||||
title: "Error",
|
||||
color: "red",
|
||||
message: "Your OpenAI Key is invalid.",
|
||||
message,
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -55,11 +55,13 @@ export function SettingsModal({ children }: { children: ReactElement }) {
|
|||
color: "red",
|
||||
message: "No internet connection.",
|
||||
});
|
||||
} else {
|
||||
}
|
||||
const message = error.response?.data?.error?.message;
|
||||
if (message) {
|
||||
notifications.show({
|
||||
title: "Error",
|
||||
color: "red",
|
||||
message: "Your OpenAI Key is invalid.",
|
||||
message,
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Reference in a new issue