check for HTTP at beginning of error message

This commit is contained in:
Dallin Romney 2025-02-05 18:58:04 -08:00
parent f29e1849f3
commit f2c6c9f4cb

View file

@ -51,7 +51,8 @@ const StreamErrorDialog = ({ error }: StreamErrorProps) => {
typeof error["message"] === "string"
) {
message = error["message"];
const status = message?.split(" ")[0];
const parts = message?.split(" ") ?? [];
const status = parts[0] === "HTTP" ? parts[1] : parts[0];
if (status) {
const code = Number(status);
if (!Number.isNaN(statusCode)) {