Commit e19d704a authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Format error messages on the client side.

parent c441b49d
...@@ -75,7 +75,7 @@ func errorToWSCloseMessage(err error) (string, []byte) { ...@@ -75,7 +75,7 @@ func errorToWSCloseMessage(err error) (string, []byte) {
default: default:
code = websocket.CloseInternalServerErr code = websocket.CloseInternalServerErr
} }
return "The server said: " + text, websocket.FormatCloseMessage(code, text) return text, websocket.FormatCloseMessage(code, text)
} }
func isWSNormalError(err error) bool { func isWSNormalError(err error) bool {
......
...@@ -344,7 +344,7 @@ function serverConnect() { ...@@ -344,7 +344,7 @@ function serverConnect() {
/* nothing */ /* nothing */
break; break;
case 'error': case 'error':
displayError(m.value); displayError('The server said: ' + m.value);
break; break;
default: default:
console.warn('Unexpected server message', m.type); console.warn('Unexpected server message', m.type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment