Add error logging to WS errors.
This commit is contained in:
parent
b0c6bc0240
commit
a2e4014b56
@ -540,9 +540,13 @@ update msg model =
|
|||||||
{ model | notifications = [], errors = (errorText error) :: model.errors } ! []
|
{ model | notifications = [], errors = (errorText error) :: model.errors } ! []
|
||||||
|
|
||||||
NewWebsocketUserMessage message ->
|
NewWebsocketUserMessage message ->
|
||||||
|
let
|
||||||
|
logError label error message =
|
||||||
|
Debug.log (label ++ " WS error: " ++ error) message
|
||||||
|
in
|
||||||
case (Mastodon.decodeWebSocketMessage message) of
|
case (Mastodon.decodeWebSocketMessage message) of
|
||||||
Mastodon.EventError error ->
|
Mastodon.EventError error ->
|
||||||
{ model | errors = error :: model.errors } ! []
|
{ model | errors = (logError "EventError" error message) :: model.errors } ! []
|
||||||
|
|
||||||
Mastodon.NotificationResult result ->
|
Mastodon.NotificationResult result ->
|
||||||
case result of
|
case result of
|
||||||
@ -550,7 +554,7 @@ update msg model =
|
|||||||
{ model | notifications = Mastodon.addNotificationToAggregates notification model.notifications } ! []
|
{ model | notifications = Mastodon.addNotificationToAggregates notification model.notifications } ! []
|
||||||
|
|
||||||
Err error ->
|
Err error ->
|
||||||
{ model | errors = error :: model.errors } ! []
|
{ model | errors = (logError "NotificationResult" error message) :: model.errors } ! []
|
||||||
|
|
||||||
Mastodon.StatusResult result ->
|
Mastodon.StatusResult result ->
|
||||||
case result of
|
case result of
|
||||||
@ -558,7 +562,7 @@ update msg model =
|
|||||||
{ model | userTimeline = status :: model.userTimeline } ! []
|
{ model | userTimeline = status :: model.userTimeline } ! []
|
||||||
|
|
||||||
Err error ->
|
Err error ->
|
||||||
{ model | errors = error :: model.errors } ! []
|
{ model | errors = (logError "StatusResult" error message) :: model.errors } ! []
|
||||||
|
|
||||||
NewWebsocketLocalMessage message ->
|
NewWebsocketLocalMessage message ->
|
||||||
-- @TODO
|
-- @TODO
|
||||||
|
Loading…
Reference in New Issue
Block a user