mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-22 11:22:27 +00:00
refactor
This commit is contained in:
1 parent
b2e46554fe
commit
5819dada32
1 file changed
+1
-2
@@ -389,8 +389,7 @@ createWithRandomBytes' size gVar create = tryCreate 3
|
||||
tryCreate n = do
|
||||
id' <- liftIO $ encodedRandomBytes gVar size
|
||||
liftIO (E.try $ create id') >>= \case
|
||||
Right (Right x) -> pure x
|
||||
Right (Left e) -> throwError e
|
||||
Right x -> liftEither x
|
||||
Left e
|
||||
| SQL.sqlError e == SQL.ErrorConstraint -> tryCreate (n - 1)
|
||||
| otherwise -> throwError . SEInternalError $ show e
|
||||
|
||||
Reference in new issue
Block a user