Copyright | (c) Sergey Vinokurov 2018 |
---|---|
License | Apache-2.0 (see LICENSE) |
Maintainer | serg.foo@gmail.com |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
This module defines various kinds of exception that this library
Synopsis
- data EmacsThrow = EmacsThrow {
- emacsThrowTag :: !(RawValue 'Regular)
- emacsThrowValue :: !(RawValue 'Regular)
- emacsThrowOrigin :: CallStack
- reportEmacsThrowToEmacs :: Env -> EmacsThrow -> IO (RawValue 'Unknown)
- data EmacsSignal = EmacsSignal {
- emacsSignalSym :: !(RawValue 'Unknown)
- emacsSignalData :: !(RawValue 'Regular)
- emacsSignalInfo :: !Text
- emacsSignalOrigin :: CallStack
- reportEmacsSignalToEmacs :: Env -> EmacsSignal -> IO (RawValue 'Unknown)
- data EmacsError = EmacsError {}
- mkEmacsError :: WithCallStack => Doc Void -> Doc Void -> EmacsError
- reportErrorToEmacs :: Env -> EmacsError -> IO (RawValue 'Unknown)
- data EmacsInternalError = EmacsInternalError {}
- mkEmacsInternalError :: WithCallStack => Doc Void -> EmacsInternalError
- reportInternalErrorToEmacs :: Env -> EmacsInternalError -> IO (RawValue 'Unknown)
- data UserError = UserError {}
- mkUserError :: WithCallStack => Doc Void -> Doc Void -> UserError
- formatSomeException :: SomeException -> Text
- reportAnyErrorToEmacs :: Env -> SomeException -> IO (RawValue 'Unknown)
- reportAllErrorsToEmacs :: Env -> IO a -> 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.
EmacsThrow | |
|
Instances
Exception EmacsThrow Source # | |
Defined in Emacs.Module.Errors toException :: EmacsThrow -> SomeException # fromException :: SomeException -> Maybe EmacsThrow # displayException :: EmacsThrow -> String # | |
Show EmacsThrow Source # | |
Defined in Emacs.Module.Errors showsPrec :: Int -> EmacsThrow -> ShowS # show :: EmacsThrow -> String # showList :: [EmacsThrow] -> ShowS # |
reportEmacsThrowToEmacs :: Env -> EmacsThrow -> IO (RawValue 'Unknown) Source #
data EmacsSignal Source #
A Haskell exception used to signal a signal
exit performed by an
Emacs function.
Unlikely to be needed when developing Emacs extensions.
EmacsSignal | |
|
Instances
Exception EmacsSignal Source # | |
Defined in Emacs.Module.Errors | |
Show EmacsSignal Source # | |
Defined in Emacs.Module.Errors showsPrec :: Int -> EmacsSignal -> ShowS # show :: EmacsSignal -> String # showList :: [EmacsSignal] -> ShowS # |
reportEmacsSignalToEmacs :: Env -> EmacsSignal -> IO (RawValue 'Unknown) Source #
data EmacsError Source #
A high-level error thrown when an Emacs function fails.
Instances
Exception EmacsError Source # | |
Defined in Emacs.Module.Errors toException :: EmacsError -> SomeException # fromException :: SomeException -> Maybe EmacsError # displayException :: EmacsError -> String # | |
Show EmacsError Source # | |
Defined in Emacs.Module.Errors showsPrec :: Int -> EmacsError -> ShowS # show :: EmacsError -> String # showList :: [EmacsError] -> ShowS # | |
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 'Unknown) Source #
data EmacsInternalError Source #
A low-level error thrown when assumptions of this package are violated and it's not safe to proceed further.
E.g. Emacs returned value not specified in a C enum - cannot really process it in a meaningful way.
Instances
Exception EmacsInternalError Source # | |
Defined in Emacs.Module.Errors | |
Show EmacsInternalError Source # | |
Defined in Emacs.Module.Errors showsPrec :: Int -> EmacsInternalError -> ShowS # show :: EmacsInternalError -> String # showList :: [EmacsInternalError] -> ShowS # | |
Pretty EmacsInternalError Source # | |
Defined in Emacs.Module.Errors pretty :: EmacsInternalError -> Doc ann # prettyList :: [EmacsInternalError] -> Doc ann # |
:: WithCallStack | |
=> Doc Void | Error message |
-> EmacsInternalError |
reportInternalErrorToEmacs :: Env -> EmacsInternalError -> IO (RawValue 'Unknown) Source #
Error thrown to emacs by Haskell functions when anything goes awry.
Instances
Exception UserError Source # | |
Defined in Emacs.Module.Errors toException :: UserError -> SomeException # fromException :: SomeException -> Maybe UserError # displayException :: UserError -> String # | |
Show UserError Source # | |
Pretty UserError Source # | |
Defined in Emacs.Module.Errors |
reportAnyErrorToEmacs :: Env -> SomeException -> IO (RawValue 'Unknown) Source #