reportUnexpectedError
    :: ( Monad m, MonadReporting m )
    => m (Either PollVerFailure a)
    -> m (Either PollVerFailure a)
reportUnexpectedError action = do
    res <- action
    -- REPORT:ERROR Internal error in update system or tips mismatch.
    res <$
        case res of
            Left (PollInternalError msg) ->
                reportError $
                "Internal error occurred in update system: " <> msg
            Left (err@(PollTipMismatch {})) -> reportError (pretty err)
            _ -> pass
reportUnexpectedError
    :: ( Monad m, MonadReporting m )
    => m (Either PollVerFailure a)
    -> m (Either PollVerFailure a)
reportUnexpectedError action = do
    res <- action
    -- REPORT:ERROR Internal error in update system or tips mismatch.
    res <$
        case res of
            Left (PollInternalError msg) ->
                reportError $
                "Internal error occurred in update system: " <> msg
            Left (err@(PollTipMismatch {})) -> reportError (pretty err)
            _ -> pass
reportUnexpectedError action = do
    res <- action
    -- REPORT:ERROR Internal error in update system or tips mismatch.
    res <$
        case res of
            Left (PollInternalError msg) ->
                reportError $
                "Internal error occurred in update system: " <> msg
            Left (err@(PollTipMismatch {})) -> reportError (pretty err)
            _ -> pass