Package com.mackenziehigh.cascade
Interface Cascade.Stage.Actor.ContextErrorHandler<I,O>
- Type Parameters:
I
- is the type of messages that the actor will consume.O
- is the type of messages that the actor will produce.
- Enclosing interface:
- Cascade.Stage.Actor<I,
O>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Actor Error Handler.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Cascade.Stage.Actor.ContextErrorHandler<I,
O> Compose this script and the given script into a single script.default Cascade.Stage.Actor.ContextErrorHandler<I,
O> Compose this script and the given script into a single script.void
This method will be invoked by the enclosing actor in order to handle any unhandled exceptions that are thrown by the script.default Cascade.Stage.Actor.ContextErrorHandler<I,
O> silent()
Compose this script within another script, such that any exceptions thrown by this script will be silently ignored.
-
Method Details
-
onError
This method will be invoked by the enclosing actor in order to handle any unhandled exceptions that are thrown by the script.The
message
is not available, in particular, if the exception occurred due to aMailbox.poll()
.- Parameters:
context
- can be used to send messages from the actor, etc.message
- was being processed when the exception occurred, if available.cause
- was thrown by the script and unhandled elsewhere.- Throws:
Throwable
- if something goes unexpectedly wrong.
-
silent
Compose this script within another script, such that any exceptions thrown by this script will be silently ignored.- Returns:
- the new script that contains this script.
-
andThen
default Cascade.Stage.Actor.ContextErrorHandler<I,O> andThen(Cascade.Stage.Actor.ContextErrorHandler<I, O> after) Compose this script and the given script into a single script.If either script throws an exception, then the exception will be silently dropped.
- Parameters:
after
- will come after this script inside of the new script.- Returns:
- the new script.
-
andThen
default Cascade.Stage.Actor.ContextErrorHandler<I,O> andThen(Cascade.Stage.Actor.ConsumerErrorHandler after) Compose this script and the given script into a single script.If either script throws an exception, then the exception will be silently dropped.
- Parameters:
after
- will come after this script inside of the new script.- Returns:
- the new script.
-