tryWithLogging :: forall m a. (MonadIO m, MonadBaseControl IO m) => m a -> m (Maybe a)
tryWithLogging action = do
    res <- try action
    case res of
        Right v -> return $ Just v
        Left (SomeException e) -> liftIO $ warningM "Sync.tryWithLogging" (show (typeOf e) ++ ": " ++ show e) >> return Nothing
tryWithLogging :: forall m a. (MonadIO m, MonadBaseControl IO m) => m a -> m (Maybe a)
tryWithLogging action = do
    res <- try action
    case res of
        Right v -> return $ Just v
        Left (SomeException e) -> liftIO $ warningM "Sync.tryWithLogging" (show (typeOf e) ++ ": " ++ show e) >> return Nothing
tryWithLogging action = do
    res <- try action
    case res of
        Right v -> return $ Just v
        Left (SomeException e) -> liftIO $ warningM "Sync.tryWithLogging" (show (typeOf e) ++ ": " ++ show e) >> return Nothing