@@ -115,7 +115,7 @@ type alias ListenErrorTagger msg =
115
115
116
116
117
117
type alias SendErrorTagger msg =
118
- ( WSPort , ClientId , String ) -> msg
118
+ ( WSPort , ClientId , String , String ) -> msg
119
119
120
120
121
121
type alias SendTagger msg =
@@ -432,10 +432,10 @@ handleCmd router state cmd =
432
432
( Dict . get wsPort state. servers
433
433
|?> ( \ server ->
434
434
Dict . get clientId server. clients
435
- |?> ( \ ws -> Native . Websocket . send ( settings0 router ( ErrorSend sendErrorTagger wsPort clientId) ( SuccessSend sendTagger wsPort clientId message)) ws message)
436
- ?= Platform . sendToSelf router ( ErrorSend sendErrorTagger wsPort clientId <| " Client does NOT exists with id: " ++ ( toString clientId))
435
+ |?> ( \ ws -> Native . Websocket . send ( settings0 router ( ErrorSend sendErrorTagger wsPort clientId message ) ( SuccessSend sendTagger wsPort clientId message)) ws message)
436
+ ?= Platform . sendToSelf router ( ErrorSend sendErrorTagger wsPort clientId message <| " Client does NOT exists with id: " ++ ( toString clientId))
437
437
)
438
- ?= Platform . sendToSelf router ( ErrorSend sendErrorTagger wsPort clientId <| " Server does NOT exists at specified port: " ++ ( toString wsPort))
438
+ ?= Platform . sendToSelf router ( ErrorSend sendErrorTagger wsPort clientId message <| " Server does NOT exists at specified port: " ++ ( toString wsPort))
439
439
, state
440
440
)
441
441
@@ -519,7 +519,7 @@ type Msg msg
519
519
| Connect WSPort Path ClientId IPAddress Websocket
520
520
| Disconnect WSPort Path ClientId IPAddress
521
521
| Message WSPort Path QueryString ClientId String
522
- | ErrorSend ( SendErrorTagger msg) WSPort ClientId String
522
+ | ErrorSend ( SendErrorTagger msg) WSPort ClientId String String
523
523
| SuccessSend ( SendTagger msg) WSPort ClientId String
524
524
| SuccessStopServer ( ServerStatusTagger msg) WSPort
525
525
| ErrorStopServer ( ServerErrorTagger msg) WSPort String
@@ -586,12 +586,12 @@ onSelfMsg router selfMsg state =
586
586
taggers
587
587
|> ( toListeners router state ( \ listenerTaggers -> listenerTaggers. messageTagger ( clientId, queryString, message )))
588
588
589
- ErrorSend sendErrorTagger wsPort clientId error ->
589
+ ErrorSend sendErrorTagger wsPort clientId message error ->
590
590
let
591
591
errorMsg =
592
592
" Send error: '" ++ error ++ " ' for server on port: " ++ ( toString wsPort) ++ " for clientId: " ++ ( toString clientId)
593
593
in
594
- ( Platform . sendToApp router <| sendErrorTagger ( wsPort, clientId, errorMsg ))
594
+ ( Platform . sendToApp router <| sendErrorTagger ( wsPort, clientId, message , errorMsg ))
595
595
&> Task . succeed state
596
596
597
597
SuccessSend sendTagger wsPort clientId message ->
0 commit comments