Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data AppError
- mapAppError :: (MonadUnliftIO m, Exception e) => (e -> AppError) -> m a -> m a
- prettyAppError :: AppError -> String
- errorPullRequest :: (HasLogFunc env, HasOptions env, HasConfig env, HasPullRequest env, HasGitHub env) => SomeException -> RIO env ()
- dieAppErrorHandlers :: [Handler IO ()]
- warnIgnore :: (Display a, HasLogFunc env) => a -> RIO env ()
Documentation
PullRequestFetchError Error | We couldn't fetch the |
PullRequestCloneError IOException | We couldn't clone or checkout the PR's branch |
ConfigurationError ConfigError | We couldn't load a |
RestylerExitFailure Restyler Int [FilePath] | A Restyler we ran exited non-zero on the given paths |
RestyleError Text | Unable to Restyle for a known reason (given as user-facing message) |
GitHubError DisplayGitHubRequest Error | We encountered a GitHub API error during restyling |
SystemError IOException | Trouble reading a file or etc |
HttpError IOException | Trouble performing some HTTP request |
OtherError SomeException | Escape hatch for anything else |
Instances
Show AppError Source # | |
Exception AppError Source # | |
Defined in Restyler.App.Error toException :: AppError -> SomeException # fromException :: SomeException -> Maybe AppError # displayException :: AppError -> String # |
mapAppError :: (MonadUnliftIO m, Exception e) => (e -> AppError) -> m a -> m a Source #
Run a computation, and modify any thrown exceptions to
sAppError
prettyAppError :: AppError -> String Source #
Error handling
errorPullRequest :: (HasLogFunc env, HasOptions env, HasConfig env, HasPullRequest env, HasGitHub env) => SomeException -> RIO env () Source #
Error the original
and re-throw the exceptionPullRequest
dieAppErrorHandlers :: [Handler IO ()] Source #
Error handlers for overall execution
Usage:
{- main routine -} `catches` dieAppErrorHandlers
Ensures all exceptions (besides
s) go through:ExitCode
dieAppError
Lower-level helpers
warnIgnore :: (Display a, HasLogFunc env) => a -> RIO env () Source #
Ignore an exception, warning about it.