Documentation Index
Fetch the complete documentation index at: https://docs.canton.network/llms.txt
Use this file to discover all available pages before exploring further.
DA.Exception
Exception handling in Daml. DEPRECATED: UsefailWithStatus and FailureStatus over Daml Exceptions
Module Snapshot
Lifecycle
Deprecated.
Notices
Status:
active
Introduced in: 3.4.9
Removed in: -
Warnings: 0
Deprecations: 2
Deprecated since: 3.4.9All deprecations (2)
All deprecations (2)
- Exceptions are deprecated, prefer
failWithStatus, and avoid using catch. - Use
-Wno-deprecated-exceptionsto disable this warning.
Data Types
type Exception = (HasThrow e, HasMessage e, HasToAnyException e, HasFromAnyException e)
Exception typeclass. This should not be implemented directly,
instead, use the exception syntax.
Typeclasses
class HasThrow e
Part of the Exception constraint.
Methods:
throwPure : e -> tThrow exception in a pure context.
instance HasThrow ArithmeticErrorinstance HasThrow AssertionFailedinstance HasThrow GeneralErrorinstance HasThrow PreconditionFailed
class HasMessage e
Part of the Exception constraint.
Methods:
message : e -> TextGet the error message associated with an exception.
instance HasMessage AnyExceptioninstance HasMessage ArithmeticErrorinstance HasMessage AssertionFailedinstance HasMessage GeneralErrorinstance HasMessage PreconditionFailed
class HasToAnyException e
Part of the Exception constraint.
Methods:
toAnyException : e -> AnyExceptionConvert an exception type to AnyException.
instance HasToAnyException AnyExceptioninstance HasToAnyException ArithmeticErrorinstance HasToAnyException AssertionFailedinstance HasToAnyException GeneralErrorinstance HasToAnyException PreconditionFailed
class HasFromAnyException e
Part of the Exception constraint.
Methods:
fromAnyException : AnyException -> Optional eConvert an AnyException back to the underlying exception type, if possible.
instance HasFromAnyException AnyExceptioninstance HasFromAnyException ArithmeticErrorinstance HasFromAnyException AssertionFailedinstance HasFromAnyException GeneralErrorinstance HasFromAnyException PreconditionFailed
class Action m => ActionThrow m
Action type in which throw is supported.
Methods:
throw : Exception e => e -> m t
instance ActionThrow Update
class ActionThrow m => ActionCatch m
Action type in which try ... catch ... is supported.
DEPRECATED: Avoid the use of catch in daml code, prefer error handling on client, and throwing using failWithStatus
Methods:
_tryCatch : (() -> m t) -> (AnyException -> Optional (m t)) -> m tHandle an exception. Use thetry ... catch ...syntax instead of calling this method directly.
instance ActionCatch Update
Orphan Typeclass Instances
-
instance GetField message GeneralError Text -
instance SetField message GeneralError Text -
instance GetField message ArithmeticError Text -
instance SetField message ArithmeticError Text -
instance GetField message PreconditionFailed Text -
instance SetField message PreconditionFailed Text -
instance GetField message AssertionFailed Text -
instance SetField message AssertionFailed Text