* Trying to catch promise and json parse errors. #489 * A few more promises.
This commit is contained in:
parent
b167deeebf
commit
ba06c1ae47
7 changed files with 379 additions and 243 deletions
|
@ -26,7 +26,11 @@ export class WebSocketService {
|
|||
|
||||
this.subject = new Observable((obs: any) => {
|
||||
this.ws.onmessage = e => {
|
||||
obs.next(JSON.parse(e.data));
|
||||
try {
|
||||
obs.next(JSON.parse(e.data));
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
};
|
||||
this.ws.onopen = () => {
|
||||
console.log(`Connected to ${wsUri}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue