java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.helidon.common.concurrency.limits.IgnoreTaskException
All Implemented Interfaces:
Serializable

public class IgnoreTaskException extends RuntimeException
If this exception is thrown from a limited task within LimitAlgorithm.invoke(java.util.concurrent.Callable), the invocation will be ignored by possible algorithms (for example when considering round-trip timing).

This should be used for cases where we never got to execute the intended task. This exception should never be thrown by Limit, it should always be translated to a proper return type, or actual exception.

See Also:
  • Constructor Details

    • IgnoreTaskException

      public IgnoreTaskException(Exception cause)
      Create a new instance with a cause.
      Parameters:
      cause - the cause of this exception
    • IgnoreTaskException

      public IgnoreTaskException(Object returnValue)
      Create a new instance with a return value.
      Parameters:
      returnValue - value to return, even though this invocation should be ignored return value may be null.
  • Method Details

    • handle

      public <T> T handle() throws Exception
      This is used by limit implementations to either return the value, or throw an exception.
      Type Parameters:
      T - type of the return value
      Returns:
      the value provided to be the return value
      Throws:
      Exception - exception provided by the task