GP-994: Improve error reporting when GADP-based models fail to start

This commit is contained in:
Dan 2022-11-08 16:37:40 -05:00
parent 7a92882ba3
commit b4d2cb75ba
14 changed files with 80 additions and 16 deletions

View file

@ -20,8 +20,7 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.RejectedExecutionException;
import java.util.function.Predicate;
import ghidra.async.AsyncUtils;
import ghidra.async.TypeSpec;
import ghidra.async.*;
import ghidra.dbg.error.*;
import ghidra.dbg.target.TargetMemory;
import ghidra.dbg.target.TargetObject;
@ -558,12 +557,16 @@ public interface DebuggerObjectModel {
* @param ex the exception
*/
default void reportError(Object origin, String message, Throwable ex) {
Throwable unwrapped = AsyncUtils.unwrapThrowable(ex);
if (ex == null || DebuggerModelTerminatingException.isIgnorable(ex)) {
Msg.warn(origin, message + ": " + ex);
}
else if (AsyncUtils.unwrapThrowable(ex) instanceof RejectedExecutionException) {
else if (unwrapped instanceof RejectedExecutionException) {
Msg.trace(origin, "Ignoring rejection", ex);
}
else if (unwrapped instanceof DisposedException) {
Msg.trace(origin, "Ignoring disposal", ex);
}
else {
Msg.error(origin, message, ex);
}