mirror of
https://github.com/gradio-app/gradio.git
synced 2025-04-12 12:40:29 +08:00
Revert "changes"
This reverts commit 96ab4e5314561411b4580ba55b4cfa5473ae03be.
This commit is contained in:
parent
2de756c69d
commit
254c7dc9c3
@ -201,7 +201,6 @@ export function api_factory(
|
||||
headers
|
||||
});
|
||||
} catch (e) {
|
||||
console.log("error 1", e);
|
||||
return [{ error: BROKEN_CONNECTION_MSG }, 500];
|
||||
}
|
||||
let output: PostResponse;
|
||||
@ -246,7 +245,6 @@ export function api_factory(
|
||||
headers
|
||||
});
|
||||
} catch (e) {
|
||||
console.log("error 2", e);
|
||||
return { error: BROKEN_CONNECTION_MSG };
|
||||
}
|
||||
const output: UploadResponse["files"] = await response.json();
|
||||
@ -561,7 +559,6 @@ export function api_factory(
|
||||
|
||||
websocket.onclose = (evt) => {
|
||||
if (!evt.wasClean) {
|
||||
console.error("error 3");
|
||||
fire_event({
|
||||
type: "status",
|
||||
stage: "error",
|
||||
@ -703,7 +700,6 @@ export function api_factory(
|
||||
hf_token
|
||||
);
|
||||
if (status !== 200) {
|
||||
console.log("error 4", status);
|
||||
fire_event({
|
||||
type: "status",
|
||||
stage: "error",
|
||||
@ -789,7 +785,6 @@ export function api_factory(
|
||||
time: new Date()
|
||||
});
|
||||
} else if (status !== 200) {
|
||||
console.log("error 5", status);
|
||||
fire_event({
|
||||
type: "status",
|
||||
stage: "error",
|
||||
@ -1062,7 +1057,6 @@ export function api_factory(
|
||||
}
|
||||
};
|
||||
event_stream.onerror = async function (event) {
|
||||
console.error("error 6", event);
|
||||
await Promise.all(
|
||||
Object.keys(event_callbacks).map((event_id) =>
|
||||
event_callbacks[event_id]({
|
||||
@ -1156,7 +1150,6 @@ export function api_factory(
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
console.log("error 7", response);
|
||||
throw new Error(BROKEN_CONNECTION_MSG);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user