Class WasmException

All Implemented Interfaces:
Serializable

public class WasmException extends RuntimeException
If there any error occur on converting a class file to a WebAssembly module.
See Also:
  • Field Details

    • lineNumber

      private int lineNumber
    • sourceFile

      private String sourceFile
    • className

      private String className
    • methodName

      private String methodName
  • Constructor Details

    • WasmException

      public WasmException(String message, int lineNumber)
      Create a new instance.
      Parameters:
      message - the error message
      lineNumber - the line number in Java Code
    • WasmException

      public WasmException(String message, String sourceFile, String className, int lineNumber)
      Create a new instance.
      Parameters:
      message - the error message
      sourceFile - the sourceFile of the Java code
      className - the class name of the Java code
      lineNumber - the line number in Java Code
    • WasmException

      private WasmException(Throwable cause)
      Create a new instance with a cause.
      Parameters:
      cause - the cause
    • WasmException

      private WasmException(String message, Throwable cause)
      Create a new instance with a cause.
      Parameters:
      message - the detail message
      cause - the cause
  • Method Details

    • create

      public static WasmException create(Throwable cause, int lineNumber)
      Create a wrapped exception needed.
      Parameters:
      cause - the wrapped cause
      lineNumber - the line number in Java Code
      Returns:
      a new instance
    • create

      public static WasmException create(Throwable cause, String sourceFile, String className, String methodName, int lineNumber)
      Create a wrapped exception needed.
      Parameters:
      cause - the wrapped cause
      sourceFile - the source file of the Java code
      className - the class name of the Java code
      methodName - the method of the Java code
      lineNumber - the line number in Java Code
      Returns:
      a new instance
    • create

      public static WasmException create(Throwable cause)
      Create a wrapped exception needed.
      Parameters:
      cause - the wrapped cause
      Returns:
      a new instance
    • create

      public static WasmException create(String message, Throwable cause)
      Create a wrapped exception needed with an additional message.
      Parameters:
      message - the message
      cause - the wrapped cause
      Returns:
      a new instance
    • getLineNumber

      public int getLineNumber()
      Get the line number in Java code on which the error occurred.
      Returns:
      the line number or -1
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable