Added manual sentry error reporting

This commit is contained in:
Mitchell McCaffrey
2020-10-27 10:26:55 +11:00
parent f096043975
commit d9cd5f78cc
6 changed files with 22 additions and 7 deletions
+4 -2
View File
@@ -4,6 +4,7 @@ import { EventEmitter } from "events";
import Connection from "./Connection";
import { omit } from "../helpers/shared";
import { logError } from "../helpers/logging";
/**
* @typedef {object} SessionPeer
@@ -112,8 +113,8 @@ class Session extends EventEmitter {
const data = await response.json();
this._iceServers = data.iceServers;
this.socket.emit("join party", partyId, password);
} catch (e) {
console.error("Unable to join party:", e.message);
} catch (error) {
logError(error);
this.emit("disconnected");
}
}
@@ -190,6 +191,7 @@ class Session extends EventEmitter {
this.peers[id] = peer;
} catch (error) {
logError(error);
this.emit("error", { error });
}
}