mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 15:37:52 +01:00
add factory method
This commit is contained in:
parent
bbb9c8c0c9
commit
dc1128cb2e
@ -23,4 +23,27 @@ package de.inetsoftware.jwebassembly;
|
|||||||
*/
|
*/
|
||||||
public class CompileException extends Exception {
|
public class CompileException extends Exception {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new instance with a cause.
|
||||||
|
*
|
||||||
|
* @param cause
|
||||||
|
* the cause
|
||||||
|
*/
|
||||||
|
CompileException( Throwable cause ) {
|
||||||
|
super( cause );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a wrapped exception needed.
|
||||||
|
*
|
||||||
|
* @param cause
|
||||||
|
* the wrapped cause
|
||||||
|
* @return a new instance
|
||||||
|
*/
|
||||||
|
public static CompileException create( Throwable cause ) {
|
||||||
|
if( cause instanceof CompileException ) {
|
||||||
|
return (CompileException)cause;
|
||||||
|
}
|
||||||
|
return new CompileException( cause );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user