websocket: default to error code 500 on any websocket error
This commit is contained in:
parent
d2fadb58f9
commit
bcf875b1d8
1 changed files with 3 additions and 3 deletions
|
@ -39,13 +39,13 @@ module Kemal
|
|||
@proc.call(socket, context)
|
||||
socket.run
|
||||
rescue error : Exception
|
||||
# TODO: check if 500 is what we're supposed to give
|
||||
context.response.status_code = 500
|
||||
|
||||
if error.is_a?(WebsocketError)
|
||||
# TODO
|
||||
context.response.status_code = 500
|
||||
code = error.code.to_i16
|
||||
message = error.status_message
|
||||
else
|
||||
context.response.status_code = error.code
|
||||
code = 1011_i16
|
||||
message = "Exception"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue