public static ScriptException unwrap(groovy.util.ScriptException cause) { // Special handling for groovy.util.ScriptException // which may be thrown by scripts because it is imported by default // by groovy imports String msg = cause.getMessage(); ScriptException translated; if (msg != null) { translated = new ScriptException(msg); } else { translated = new ScriptException(); } translated.setStackTrace(cause.getStackTrace()); return translated; }
static ScriptException toScript(Throwable cause) { if (cause instanceof ScriptException) { return (ScriptException)cause; } if (cause instanceof groovy.util.ScriptException) { // Special handling for groovy.util.ScriptException // which may be thrown by scripts because it is imported by default // by groovy imports String msg = cause.getMessage(); ScriptException translated; if (msg != null) { translated = new ScriptException(msg); } else { translated = new ScriptException(); } translated.setStackTrace(cause.getStackTrace()); return translated; } else { return new ScriptException(cause); } }
public static ScriptException unwrap(groovy.util.ScriptException cause) { // Special handling for groovy.util.ScriptException // which may be thrown by scripts because it is imported by default // by groovy imports String msg = cause.getMessage(); ScriptException translated; if (msg != null) { translated = new ScriptException(msg); } else { translated = new ScriptException(); } translated.setStackTrace(cause.getStackTrace()); return translated; }
public static ScriptException unwrap(groovy.util.ScriptException cause) { // Special handling for groovy.util.ScriptException // which may be thrown by scripts because it is imported by default // by groovy imports String msg = cause.getMessage(); ScriptException translated; if (msg != null) { translated = new ScriptException(msg); } else { translated = new ScriptException(); } translated.setStackTrace(cause.getStackTrace()); return translated; }