mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 14:30:02 -04:00
add libcurl error strings to fetch error messages
This commit is contained in:
parent
c9236f90d5
commit
155d5ea5b6
8 changed files with 18 additions and 10 deletions
|
@ -44,7 +44,7 @@ class FakeWebSocket extends EventTarget {
|
|||
|
||||
this.socket.onerror = (error) => {
|
||||
this.status = this.CLOSED;
|
||||
console.error(`websocket ${this.url} encountered an error (${error})`);
|
||||
error_msg(`websocket ${this.url} encountered an error (${error})`);
|
||||
let error_event = new Event("error");
|
||||
this.dispatchEvent(error_event);
|
||||
this.onerror(error_event);
|
||||
|
@ -66,7 +66,7 @@ class FakeWebSocket extends EventTarget {
|
|||
throw "invalid binaryType string";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let msg_event = new MessageEvent("message", {data: converted});
|
||||
this.onmessage(msg_event);
|
||||
this.dispatchEvent(msg_event);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue