From e19d704a0abbb0bfebd7bb030d7ea270a4653e11 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sun, 26 Apr 2020 19:15:02 +0200 Subject: [PATCH] Format error messages on the client side. --- client.go | 2 +- static/sfu.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client.go b/client.go index a300b89..1efd5a5 100644 --- a/client.go +++ b/client.go @@ -75,7 +75,7 @@ func errorToWSCloseMessage(err error) (string, []byte) { default: code = websocket.CloseInternalServerErr } - return "The server said: " + text, websocket.FormatCloseMessage(code, text) + return text, websocket.FormatCloseMessage(code, text) } func isWSNormalError(err error) bool { diff --git a/static/sfu.js b/static/sfu.js index abe4211..da45d10 100644 --- a/static/sfu.js +++ b/static/sfu.js @@ -344,7 +344,7 @@ function serverConnect() { /* nothing */ break; case 'error': - displayError(m.value); + displayError('The server said: ' + m.value); break; default: console.warn('Unexpected server message', m.type);