Improve exception reporting
Add the source spec in the error stacktrace Original commit: elastic/x-pack-elasticsearch@bc7ed6ac60
This commit is contained in:
parent
6f670c8d8e
commit
12e12f7a94
|
@ -84,7 +84,7 @@ public class CsvSpecIntegrationTest extends SpecBaseIntegrationTestCase {
|
|||
throw reworkException(new AssertionError(errorMessage(ae), ae.getCause()));
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw new RuntimeException(errorMessage(th), th);
|
||||
throw reworkException(th);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public abstract class SpecBaseIntegrationTestCase extends ESTestCase {
|
|||
StackTraceElement[] stackTrace = th.getStackTrace();
|
||||
StackTraceElement[] redone = new StackTraceElement[stackTrace.length + 1];
|
||||
System.arraycopy(stackTrace, 0, redone, 1, stackTrace.length);
|
||||
redone[0] = new StackTraceElement(getClass().getName(), groupName + "." + testName, source.getFileName().toString(), lineNumber);
|
||||
redone[0] = new StackTraceElement(getClass().getName(), groupName + ".test" + testName, source.getFileName().toString(), lineNumber);
|
||||
|
||||
th.setStackTrace(redone);
|
||||
return th;
|
||||
|
|
|
@ -71,8 +71,7 @@ public class SqlSpecIntegrationTest extends SpecBaseIntegrationTestCase {
|
|||
throw reworkException(new AssertionError(errorMessage(ae), ae.getCause()));
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
//throw reworkException(new RuntimeException(errorMessage(th)));
|
||||
throw th;
|
||||
throw reworkException(th);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue