mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
Simplify the usage of the exception
This commit is contained in:
parent
f15e9c8341
commit
a49288449d
@ -29,6 +29,18 @@ public class WasmException extends RuntimeException {
|
||||
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* Create a new instance.
|
||||
*
|
||||
* @param message
|
||||
* the error message
|
||||
* @param lineNumber
|
||||
* the line number in Java Code
|
||||
*/
|
||||
public WasmException( String message, int lineNumber ) {
|
||||
this( message, null, null, lineNumber );
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance.
|
||||
*
|
||||
@ -44,6 +56,7 @@ public class WasmException extends RuntimeException {
|
||||
public WasmException( String message, String sourceFile, String className, int lineNumber ) {
|
||||
super( message );
|
||||
this.sourceFile = sourceFile;
|
||||
this.className = className;
|
||||
this.lineNumber = lineNumber;
|
||||
}
|
||||
|
||||
@ -58,6 +71,19 @@ public class WasmException extends RuntimeException {
|
||||
lineNumber = -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a wrapped exception needed.
|
||||
*
|
||||
* @param cause
|
||||
* the wrapped cause
|
||||
* @param lineNumber
|
||||
* the line number in Java Code
|
||||
* @return a new instance
|
||||
*/
|
||||
public static WasmException create( Throwable cause, int lineNumber ) {
|
||||
return create( cause, null, null, lineNumber );
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a wrapped exception needed.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user