1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Make sure stack traces are logged for CoreExceptions

Change-Id: I4686473c8925c241f16a79892382359829ec1625
This commit is contained in:
Nathan Ridge 2017-07-06 02:10:45 -04:00
parent c4990122ac
commit 8286a3e2d4

View file

@ -1542,7 +1542,15 @@ public class CCorePlugin extends Plugin {
*/
public static void log(Throwable e) {
if (e instanceof CoreException) {
log(((CoreException) e).getStatus());
// If the CoreException doesn't have a nested exception, wrap it
// into another Status object. This ensures that we can see its
// stack trace.
IStatus status = ((CoreException) e).getStatus();
if (status.getException() != null) {
log(status);
} else {
log(createStatus("Error", e)); //$NON-NLS-1$
}
} else {
String msg = e.getMessage();
if (msg == null) {