1
Fork 0

Format error messages on the client side.

This commit is contained in:
Juliusz Chroboczek 2020-04-26 19:15:02 +02:00
parent c441b49d26
commit e19d704a0a
2 changed files with 2 additions and 2 deletions

View File

@ -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 {

View File

@ -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);