Format error messages on the client side.
This commit is contained in:
@@ -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 {
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user