Source code for curry.exceptions


[docs] class CompileError(BaseException): '''Raised when an error occurs while compiling Curry code.'''
[docs] class InstantiationError(BaseException): '''Raised when a free variable is bound to an unboxed value.'''
[docs] class NotConstructorError(ValueError): '''Raised when a non-constructor value occurs where disallowed.''' def __init__(self, arg): self.arg = arg
[docs] class ModuleLookupError(ValueError): '''Raised when a Curry module is not found.'''
[docs] class SymbolLookupError(AttributeError): '''Raised when a Curry symbol is not found.'''
[docs] class TypeLookupError(AttributeError): '''Raised when a Curry type is not found.'''
[docs] class CurryIndexError(IndexError): '''Raised when indexing into a Curry expression fails.''' pass
[docs] class CurryTypeError(TypeError): '''Raised when a type error occurs while evaluating a Curry program.'''
[docs] class TimeoutError(RuntimeError): pass
[docs] class PrerequisiteError(IOError): '''Raised when a build prerequisite is invalid.'''
[docs] class DynloadError(RuntimeError): '''Raised when a compiled Curry module cannot be loaded.'''
###### # Evaluation Errors
[docs] class EvaluationError(BaseException): '''Signals an error raised from a Curry program.''' pass
[docs] class EvaluationSuspended(EvaluationError): '''Evaluation failed due to suspended constraints.''' def __init__(self): EvaluationError.__init__(self, 'Evaluation Suspended!')
[docs] class MonadError(EvaluationError): # Prelude.IOError CTOR_INDEX = 0 def __init__(self): EvaluationError.__init__(self, 'An IO error occurred in monadic actions!')
[docs] class UserMonadError(MonadError): # Prelude.UserError CTOR_INDEX = 1 def __init__(self): EvaluationError.__init__(self, 'A user error occurred in monadic actions!')
[docs] class FailMonadError(MonadError): # Prelude.FailError CTOR_INDEX = 2 def __init__(self): EvaluationError.__init__( self, 'A failed computation occurred in monadic actions!' )
[docs] class NondetMonadError(MonadError): # Prelude.NondetError # Non-determinism occurred in monadic actions. CTOR_INDEX = 3 def __init__(self): EvaluationError.__init__( self, 'non-determinism in monadic actions occurred!' )