diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-03-11 20:22:33 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-03-21 20:15:21 +0100 |
commit | 83d291f476a9793012a7aabb27c3cf59c7bdea05 (patch) | |
tree | 42b60eac72c25df8280e412e706acbae80fa7a8b /src/Erebos/Identity.hs | |
parent | f612d03ac7d5fb00fa76c3be14d965ab51988504 (diff) |
Generic type for MonadError constraints
Changelog: API: MonadError constraints use generic error type
Diffstat (limited to 'src/Erebos/Identity.hs')
-rw-r--r-- | src/Erebos/Identity.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Erebos/Identity.hs b/src/Erebos/Identity.hs index e75999d..a3f17b5 100644 --- a/src/Erebos/Identity.hs +++ b/src/Erebos/Identity.hs @@ -280,13 +280,13 @@ validateExtendedIdentityFE mdata = do Just mk -> return mk loadIdentity :: String -> LoadRec ComposedIdentity -loadIdentity name = maybe (throwError "identity validation failed") return . validateExtendedIdentityF =<< loadRefs name +loadIdentity name = maybe (throwOtherError "identity validation failed") return . validateExtendedIdentityF =<< loadRefs name loadMbIdentity :: String -> LoadRec (Maybe ComposedIdentity) loadMbIdentity name = return . validateExtendedIdentityF =<< loadRefs name loadUnifiedIdentity :: String -> LoadRec UnifiedIdentity -loadUnifiedIdentity name = maybe (throwError "identity validation failed") return . validateExtendedIdentity =<< loadRef name +loadUnifiedIdentity name = maybe (throwOtherError "identity validation failed") return . validateExtendedIdentity =<< loadRef name loadMbUnifiedIdentity :: String -> LoadRec (Maybe UnifiedIdentity) loadMbUnifiedIdentity name = return . (validateExtendedIdentity =<<) =<< loadMbRef name @@ -322,7 +322,7 @@ lookupProperty sel topHeads = findResult propHeads findResult [] = Nothing findResult xs = sel $ fromSigned $ minimum xs -mergeIdentity :: (MonadStorage m, MonadError String m, MonadIO m) => Identity f -> m UnifiedIdentity +mergeIdentity :: (MonadStorage m, MonadError e m, FromErebosError e, MonadIO m) => Identity f -> m UnifiedIdentity mergeIdentity idt | Just idt' <- toUnifiedIdentity idt = return idt' mergeIdentity idt@Identity {..} = do (owner, ownerData) <- case idOwner_ of |