Copyright | (c) Sergey Vinokurov 2018 |
---|---|
License | BSD3-style (see LICENSE) |
Maintainer | serg.foo@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
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.
Instances
Show EmacsThrow Source # | |
Defined in Emacs.Module.Errors showsPrec :: Int -> EmacsThrow -> ShowS # show :: EmacsThrow -> String # showList :: [EmacsThrow] -> ShowS # | |
Exception EmacsThrow Source # | |
Defined in Emacs.Module.Errors 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.
Instances
Show UserError Source # | |
Exception UserError Source # | |
Defined in Emacs.Module.Errors 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.
Instances
Show EmacsError Source # | |
Defined in Emacs.Module.Errors showsPrec :: Int -> EmacsError -> ShowS # show :: EmacsError -> String # showList :: [EmacsError] -> ShowS # | |
Exception EmacsError Source # | |
Defined in Emacs.Module.Errors toException :: EmacsError -> SomeException # fromException :: SomeException -> Maybe EmacsError # displayException :: EmacsError -> String # | |
Pretty EmacsError Source # | |
Defined in Emacs.Module.Errors pretty :: EmacsError -> Doc ann # prettyList :: [EmacsError] -> Doc ann # |
:: 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.
Instances
Show EmacsInternalError Source # | |
Defined in Emacs.Module.Errors showsPrec :: Int -> EmacsInternalError -> ShowS # show :: EmacsInternalError -> String # showList :: [EmacsInternalError] -> ShowS # | |
Exception EmacsInternalError Source # | |
Defined in Emacs.Module.Errors | |
Pretty EmacsInternalError Source # | |
Defined in Emacs.Module.Errors pretty :: EmacsInternalError -> Doc ann # prettyList :: [EmacsInternalError] -> Doc ann # |
:: WithCallStack | |
=> Doc Void | Error message |
-> EmacsInternalError |
reportAnyErrorToEmacs :: Env -> SomeException -> IO RawValue Source #
reportAllErrorsToEmacs Source #
:: 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.