Report non-network-failure exceptions more clearly

This commit is contained in:
Tony Garnock-Jones 2016-06-06 10:36:00 -04:00
parent f4d1f5c800
commit cd94df3cab
1 changed files with 5 additions and 1 deletions

View File

@ -110,7 +110,11 @@
(handle-evt c-input-port
(lambda (dummy)
(define msg
(with-handlers ([exn:fail:network? (lambda (e) eof)])
(with-handlers ([exn:fail:network? (lambda (e) eof)]
[exn:fail? (lambda (e)
(log-error "Unexpected ws-recv error: ~a"
(exn->string e))
eof)])
(ws-recv c #:payload-type 'text)))
(send-ground-message (websocket-incoming-message id msg))
(loop (or blocked? (eof-object? msg))))))))