-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
I use this client to create a room and then invite another user.
It works so far, it does create the room and invite the user. But then, I get an exception:
user error (Error in $: parsing () failed, expected Array, but encountered Object)
It seems to be a Aeson parse exception on the response returned by the matrix server. I could only handle that exception with a try/catch but it seems like a bug in this package to me.
I'm using version 0.1.4.3 (latest on hackage).
This is my code:
createPrivateMatrixRoom :: ClientSession -> Text -> Text -> Text -> [UserID] -> IO ()
createPrivateMatrixRoom sess alias name description users = do
roomResult <- createRoom sess $ RoomCreateRequest PrivateChat alias name description
case roomResult of
Right roomId -> do
inviteResults <- mapM (flip (inviteToRoom sess roomId) Nothing) users
case lefts inviteResults of
[] -> return ()
err -> error $ "error: could not invite some users. details: " ++ show err
Left err -> error $ "error: could not create matrix room, maybe due to existing canonical alias. details: " ++ show err
Metadata
Metadata
Assignees
Labels
No labels