Check for response ok

This commit is contained in:
Cohee
2024-11-23 16:01:14 +02:00
parent 50922c11fa
commit 2e661c36e5

View File

@ -1249,6 +1249,7 @@ async function getStatusTextgen() {
}),
});
if (response.ok) {
const data = await response.json();
if (data) {
const { chat_template, chat_template_hash } = data;
@ -1265,6 +1266,7 @@ async function getStatusTextgen() {
}
}
}
}
// We didn't get a 200 status code, but the endpoint has an explanation. Which means it DID connect, but I digress.
if (online_status === 'no_connection' && data.response) {