1
0
Fork 0

[client] Show errors sent by the server in the console.

This commit is contained in:
Starbeamrainbowlabs 2017-04-23 17:26:29 +01:00
parent 363fdbb20c
commit ffd2b32abb
2 changed files with 6 additions and 1 deletions

View File

@ -378,7 +378,7 @@ namespace Nibriboard.Client
if(CurrentPlane == null)
{
Send(new ErrorMessage() {
Message = "Error: You can't complete a line until you've selected a plane" +
Message = "Error: You can't complete a line until you've selected a plane " +
"to draw it on!"
});
return;

View File

@ -22,6 +22,7 @@ class RippleLink extends EventEmitter
// Respond to heartbeats from the server
this.on("Heartbeat", this.handleHeartbeat.bind(this));
this.on("Error", this.handleErrorMessage.bind(this));
// Close the socket correctly
window.addEventListener("beforeunload", (function(event) {
@ -49,6 +50,10 @@ class RippleLink extends EventEmitter
this.emit(message.Event, message);
}
handleErrorMessage(message) {
console.error(message.Message);
}
/**
* Replies to heartbeat messages from the server.
*/