ormolu-0.1.4.1: A formatter for Haskell source code
Safe HaskellNone
LanguageHaskell2010

Ormolu.Exception

Description

OrmoluException type and surrounding definitions.

Synopsis

Documentation

data OrmoluException Source #

Ormolu exception representing all cases when Ormolu can fail.

Constructors

OrmoluParsingFailed SrcSpan String

Parsing of original source code failed

OrmoluOutputParsingFailed SrcSpan String

Parsing of formatted source code failed

OrmoluASTDiffers FilePath [SrcSpan]

Original and resulting ASTs differ

OrmoluNonIdempotentOutput TextDiff

Formatted source code is not idempotent

OrmoluUnrecognizedOpts (NonEmpty String)

Some GHC options were not recognized

Instances

Instances details
Eq OrmoluException Source # 
Instance details

Defined in Ormolu.Exception

Show OrmoluException Source # 
Instance details

Defined in Ormolu.Exception

Methods

showsPrec :: Int -> OrmoluException -> ShowS

show :: OrmoluException -> String

showList :: [OrmoluException] -> ShowS

Exception OrmoluException Source # 
Instance details

Defined in Ormolu.Exception

Methods

toException :: OrmoluException -> SomeException

fromException :: SomeException -> Maybe OrmoluException

displayException :: OrmoluException -> String

withPrettyOrmoluExceptions Source #

Arguments

:: ColorMode

Color mode

-> IO ExitCode

Action that may throw an exception

-> IO ExitCode 

Inside this wrapper OrmoluException will be caught and displayed nicely.