Skip to content

Commit d5f1a8a

Browse files
committed
Replace Text error with MLSProtocolError
1 parent 0ba778f commit d5f1a8a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

services/galley/src/Galley/API/Federation.hs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -543,19 +543,18 @@ sendMLSMessage ::
543543
F.MessageSendRequest ->
544544
Sem r F.MLSMessageResponse
545545
sendMLSMessage remoteDomain msr =
546-
fmap (either F.MLSMessageResponseProtocolError id)
547-
. runError
546+
fmap (either (F.MLSMessageResponseProtocolError . unTagged) id)
547+
. runError @MLSProtocolError
548548
. fmap (either F.MLSMessageResponseError id)
549549
. runError
550550
. fmap (either (F.MLSMessageResponseProposalFailure . pfInner) id)
551551
. runError
552552
$ do
553553
loc <- qualifyLocal ()
554554
let sender = toRemoteUnsafe remoteDomain (F.msrSender msr)
555-
raw <- either throw pure $ decodeMLS' (fromBase64ByteString (F.msrRawMessage msr))
556-
mapToGalleyError @MLSMessageStaticErrors
557-
. mapError @MLSProtocolError unTagged
558-
$ F.MLSMessageResponseUpdates . map lcuUpdate
555+
raw <- either (throw . mlsProtocolError) pure $ decodeMLS' (fromBase64ByteString (F.msrRawMessage msr))
556+
mapToGalleyError @MLSMessageStaticErrors $
557+
F.MLSMessageResponseUpdates . map lcuUpdate
559558
<$> postMLSMessage loc (qUntagged sender) Nothing raw
560559

561560
class ToGalleyRuntimeError (effs :: EffectRow) r where

0 commit comments

Comments
 (0)