mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 13:08:29 +00:00
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()));
|
throw reworkException(new AssertionError(errorMessage(ae), ae.getCause()));
|
||||||
}
|
}
|
||||||
} catch (Throwable th) {
|
} 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[] stackTrace = th.getStackTrace();
|
||||||
StackTraceElement[] redone = new StackTraceElement[stackTrace.length + 1];
|
StackTraceElement[] redone = new StackTraceElement[stackTrace.length + 1];
|
||||||
System.arraycopy(stackTrace, 0, redone, 1, stackTrace.length);
|
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);
|
th.setStackTrace(redone);
|
||||||
return th;
|
return th;
|
||||||
|
@ -71,8 +71,7 @@ public class SqlSpecIntegrationTest extends SpecBaseIntegrationTestCase {
|
|||||||
throw reworkException(new AssertionError(errorMessage(ae), ae.getCause()));
|
throw reworkException(new AssertionError(errorMessage(ae), ae.getCause()));
|
||||||
}
|
}
|
||||||
} catch (Throwable th) {
|
} catch (Throwable th) {
|
||||||
//throw reworkException(new RuntimeException(errorMessage(th)));
|
throw reworkException(th);
|
||||||
throw th;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user