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.

@FunctionalInterface public static interface Cascade.Stage.Actor.ContextErrorHandler<I,O>
Actor Error Handler.
  • Method Details

    • onError

      void onError(Cascade.Stage.Actor.Context<I,O> context, I message, Throwable cause) throws Throwable
      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 a Mailbox.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

      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

      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.