UserExceptionAdvancedExtension extension

on

Properties

hardCause Object?
The hard cause is some error which caused the UserException, but that is not a UserException itself. For example: int.parse('a') throws a FormatException. Then: throw UserException('Invalid number').addCause(FormatException('Invalid input')). will have the FormatException as the hard cause. Note: If a UserException is passed as the hard cause, it will be added with addCause, and will not become the hard cause. In other words, a UserException will never be a hard cause.
no setter
onCancel VoidCallback?
The onCancel callback of the exception, or null if it was not defined.
no setter
onOk VoidCallback?
The onOk callback of the exception, or null if it was not defined.
no setter
props → IMap<String, dynamic>
The properties added to the exception, if any. They are an immutable-map of type IMap, of key-value pairs. To read the properties, use the [] operator, like this:
no setter

Methods

addCallbacks({VoidCallback? onOk, VoidCallback? onCancel}) UserException
Adds callbacks to the UserException.
addCause(Object? cause) UserException
Returns a UserException from the current one, by adding the given cause. Note the added cause won't replace the original cause, but will be added to it.
addProps(Map<String, dynamic>? moreProps) UserException
Adds moreProps to the properties of the UserException. If the exception already had props, the new moreProps will be merged with those.