mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Renaming Kit.initCauseOrNull into simple Kit.initCause and making it to
return the passed exception to allow usage like: throw Kit.initCause(new RuntimeException("WRAPPED"), origException);
This commit is contained in:
parent
b6ea76c9ef
commit
83a55815ca
@ -110,8 +110,9 @@ public class Kit
|
||||
/**
|
||||
* If initCause methods exists in Throwable, call
|
||||
* <tt>ex.initCause(cause)</tt> or otherwise do nothing.
|
||||
* @return The <tt>ex</tt> argument.
|
||||
*/
|
||||
public static void initCauseOrIgnore(Throwable ex, Throwable cause)
|
||||
public static Throwable initCause(Throwable ex, Throwable cause)
|
||||
{
|
||||
if (Throwable_initCause != null) {
|
||||
Object[] args = { cause };
|
||||
@ -121,6 +122,7 @@ public class Kit
|
||||
// Ignore any exceptions
|
||||
}
|
||||
}
|
||||
return ex;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,7 +54,7 @@ public class WrappedException extends EvaluatorException
|
||||
{
|
||||
super("Wrapped "+exception.toString());
|
||||
this.exception = exception;
|
||||
Kit.initCauseOrIgnore(this, exception);
|
||||
Kit.initCause(this, exception);
|
||||
|
||||
Context cx = Context.getCurrentContext();
|
||||
if (cx!= null) {
|
||||
|
Loading…
Reference in New Issue
Block a user