Class PythonAsyncioRuntime.ExceptionCompleter

java.lang.Object
io.micronaut.context.python.PythonAsyncioRuntime.ExceptionCompleter
Enclosing class:
PythonAsyncioRuntime

public static final class PythonAsyncioRuntime.ExceptionCompleter extends Object
Completes futures with Java exceptions from Python exception data.
  • Method Details

    • completeExceptionally

      public void completeExceptionally(CompletableFuture<?> future, String exceptionType, String message)
      Complete a future exceptionally.
      Parameters:
      future - The future.
      exceptionType - The Python exception type.
      message - The Python exception message.
    • completeExceptionally

      public void completeExceptionally(CompletableFuture<?> future, org.graalvm.polyglot.Value exception)
      Complete a future exceptionally with the Java view of a Python exception object.

      Java exceptions raised inside the coroutine keep their type, generated Python exception wrappers are instantiated, and other Python exceptions surface as a PolyglotException.

      Parameters:
      future - The future.
      exception - The Python exception object.