ormolu-0.5.3.0: A formatter for Haskell source code

Safe Haskell | Safe-Inferred
Language | Haskell2010

Ormolu.Exception

Description

`OrmoluException` type and surrounding definitions.

Synopsis

- data OrmoluException
  - = OrmoluParsingFailed SrcSpan String
  - | OrmoluOutputParsingFailed SrcSpan String
  - | OrmoluASTDiffers TextDiff [RealSrcSpan]
  - | OrmoluNonIdempotentOutput TextDiff
  - | OrmoluUnrecognizedOpts (NonEmpty String)
  - | OrmoluCabalFileParsingFailed FilePath
  - | OrmoluMissingStdinInputFile
  - | OrmoluFixityOverridesParseError (ParseErrorBundle Text Void)
- printOrmoluException :: OrmoluException -> Term ()
- withPrettyOrmoluExceptions :: ColorMode -> IO ExitCode -> IO ExitCode

# 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 TextDiff [RealSrcSpan] | Original and resulting ASTs differ
OrmoluNonIdempotentOutput TextDiff | Formatted source code is not idempotent
OrmoluUnrecognizedOpts (NonEmpty String) | Some GHC options were not recognized
OrmoluCabalFileParsingFailed FilePath | Cabal file parsing failed
OrmoluMissingStdinInputFile | Missing input file path when using stdin input and accounting for .cabal files
OrmoluFixityOverridesParseError (ParseErrorBundle Text Void) | A parse error in a fixity overrides file

#### Instances

Instances details

Exception OrmoluException Source # |
Instance details Defined in Ormolu.Exception Methods toException :: OrmoluException -> SomeException Source # fromException :: SomeException -> Maybe OrmoluException Source # displayException :: OrmoluException -> String Source #
Show OrmoluException Source # |
Instance details Defined in Ormolu.Exception Methods showsPrec :: Int -> OrmoluException -> ShowS Source # show :: OrmoluException -> String Source # showList :: [OrmoluException] -> ShowS Source #
Eq OrmoluException Source # |
Instance details Defined in Ormolu.Exception Methods (==) :: OrmoluException -> OrmoluException -> Bool Source # (/=) :: OrmoluException -> OrmoluException -> Bool Source #

printOrmoluException :: OrmoluException -> Term () Source #

Print an `OrmoluException`.

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.