| Copyright | (c) Sergey Vinokurov 2018 |
|---|---|
| License | BSD3-style (see LICENSE) |
| Maintainer | serg.foo@gmail.com |
| Safe Haskell | None |
| Language | Haskell2010 |
Emacs.Module.Errors
Description
This module defines various kinds of exception that this library
Synopsis
- data EmacsThrow = EmacsThrow {}
- reportEmacsThrowToEmacs :: Env -> EmacsThrow -> IO RawValue
- data UserError = UserError {}
- mkUserError :: WithCallStack => Doc Void -> Doc Void -> UserError
- data EmacsError = EmacsError {}
- mkEmacsError :: WithCallStack => Doc Void -> Doc Void -> EmacsError
- reportErrorToEmacs :: Env -> EmacsError -> IO RawValue
- data EmacsInternalError = EmacsInternalError {}
- mkEmacsInternalError :: WithCallStack => Doc Void -> EmacsInternalError
- reportInternalErrorToEmacs :: Env -> EmacsInternalError -> IO RawValue
- formatSomeException :: SomeException -> Text
- reportAnyErrorToEmacs :: Env -> SomeException -> IO RawValue
- reportAllErrorsToEmacs :: Env -> IO a -> ((Throws EmacsInternalError, Throws EmacsError, Throws UserError, Throws EmacsThrow) => IO a) -> IO a
Documentation
data EmacsThrow Source #
A Haskell exception used to signal a throw exit performed by an
Emacs function.
Unlikely to be needed when developing Emacs extensions.
Constructors
| EmacsThrow | |
Fields
| |
Instances
| Show EmacsThrow Source # | |
Defined in Emacs.Module.Errors Methods showsPrec :: Int -> EmacsThrow -> ShowS # show :: EmacsThrow -> String # showList :: [EmacsThrow] -> ShowS # | |
| Exception EmacsThrow Source # | |
Defined in Emacs.Module.Errors Methods toException :: EmacsThrow -> SomeException # fromException :: SomeException -> Maybe EmacsThrow # displayException :: EmacsThrow -> String # | |
reportEmacsThrowToEmacs :: Env -> EmacsThrow -> IO RawValue Source #
Error thrown to emacs by Haskell functions when anything goes awry.
Constructors
| UserError | |
Fields
| |
Instances
| Show UserError Source # | |
| Exception UserError Source # | |
Defined in Emacs.Module.Errors Methods toException :: UserError -> SomeException # fromException :: SomeException -> Maybe UserError # displayException :: UserError -> String # | |
| Pretty UserError Source # | |
Defined in Emacs.Module.Errors | |
data EmacsError Source #
A high-level error thrown when an Emacs function fails.
Constructors
| EmacsError | |
Fields
| |
Instances
| Show EmacsError Source # | |
Defined in Emacs.Module.Errors Methods showsPrec :: Int -> EmacsError -> ShowS # show :: EmacsError -> String # showList :: [EmacsError] -> ShowS # | |
| Exception EmacsError Source # | |
Defined in Emacs.Module.Errors Methods toException :: EmacsError -> SomeException # fromException :: SomeException -> Maybe EmacsError # displayException :: EmacsError -> String # | |
| Pretty EmacsError Source # | |
Defined in Emacs.Module.Errors | |
Arguments
| :: WithCallStack | |
| => Doc Void | Message |
| -> Doc Void | Error data from Emacs |
| -> EmacsError |
reportErrorToEmacs :: Env -> EmacsError -> IO RawValue Source #
data EmacsInternalError Source #
A low-level error thrown when assumptions of this package are violated and it's not safe to proceed further.
Constructors
| EmacsInternalError | |
Fields | |
Instances
| Show EmacsInternalError Source # | |
Defined in Emacs.Module.Errors Methods showsPrec :: Int -> EmacsInternalError -> ShowS # show :: EmacsInternalError -> String # showList :: [EmacsInternalError] -> ShowS # | |
| Exception EmacsInternalError Source # | |
Defined in Emacs.Module.Errors Methods toException :: EmacsInternalError -> SomeException # fromException :: SomeException -> Maybe EmacsInternalError # | |
| Pretty EmacsInternalError Source # | |
Defined in Emacs.Module.Errors | |
Arguments
| :: WithCallStack | |
| => Doc Void | Error message |
| -> EmacsInternalError |
reportAnyErrorToEmacs :: Env -> SomeException -> IO RawValue Source #
reportAllErrorsToEmacs Source #
Arguments
| :: Env | |
| -> IO a | Result to return on error. |
| -> ((Throws EmacsInternalError, Throws EmacsError, Throws UserError, Throws EmacsThrow) => IO a) | |
| -> IO a |
Catch all errors this package might throw in an IO action and make Emacs aware of them.
This is a convenience function intended to be used around exported
initialise entry point into an Emacs module.