mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 15:37:52 +01:00
add lineNumber
This commit is contained in:
parent
dc1128cb2e
commit
704a08cfcd
@ -23,6 +23,21 @@ package de.inetsoftware.jwebassembly;
|
|||||||
*/
|
*/
|
||||||
public class CompileException extends Exception {
|
public class CompileException extends Exception {
|
||||||
|
|
||||||
|
private final int lineNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new instance.
|
||||||
|
*
|
||||||
|
* @param message
|
||||||
|
* the error message
|
||||||
|
* @param lineNumber
|
||||||
|
* the line number in Java Code
|
||||||
|
*/
|
||||||
|
public CompileException( String message, int lineNumber ) {
|
||||||
|
super( message );
|
||||||
|
this.lineNumber = lineNumber;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance with a cause.
|
* Create a new instance with a cause.
|
||||||
*
|
*
|
||||||
@ -31,6 +46,7 @@ public class CompileException extends Exception {
|
|||||||
*/
|
*/
|
||||||
CompileException( Throwable cause ) {
|
CompileException( Throwable cause ) {
|
||||||
super( cause );
|
super( cause );
|
||||||
|
lineNumber = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,4 +62,13 @@ public class CompileException extends Exception {
|
|||||||
}
|
}
|
||||||
return new CompileException( cause );
|
return new CompileException( cause );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the line number in Java code on which the error occurred.
|
||||||
|
*
|
||||||
|
* @return the line number or -1
|
||||||
|
*/
|
||||||
|
public int getLineNumber() {
|
||||||
|
return lineNumber;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user