diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index b17db45b79..134f571343 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -2158,7 +2158,7 @@ processChatCommand' vr = \case let collect (acId, ds) = if not showAll && agentDeliveryOk ds then Nothing else Just (decodeLatin1 $ strEncode acId, ds) pure $ CRDebugDelivery . M.fromList . mapMaybe collect $ M.toList ads DebugConnection acId@(AgentConnId acId') -> do - user@User {userId} <- withStore' (`getUserByAConnId` acId) >>= maybe (throwChatError undefined) pure + user@User {userId} <- withStore' (`getUserByAConnId` acId) >>= maybe (throwError . ChatErrorStore $ SEUserNotFoundByAConnId acId) pure AS.RcvQueue {server, rcvId = rcvId', status = rqStatus} <- withAgent $ \ac -> -- dive into agent internals liftIOEither . (`runReaderT` agentEnv ac) . runExceptT $ AC.withStore ac $ \adb -> diff --git a/src/Simplex/Chat/Store/Shared.hs b/src/Simplex/Chat/Store/Shared.hs index fe86b0c2df..4dd8caef4a 100644 --- a/src/Simplex/Chat/Store/Shared.hs +++ b/src/Simplex/Chat/Store/Shared.hs @@ -59,6 +59,7 @@ data StoreError = SEDuplicateName | SEUserNotFound {userId :: UserId} | SEUserNotFoundByName {contactName :: ContactName} + | SEUserNotFoundByAConnId {agentConnId :: AgentConnId} | SEUserNotFoundByContactId {contactId :: ContactId} | SEUserNotFoundByGroupId {groupId :: GroupId} | SEUserNotFoundByFileId {fileId :: FileTransferId}