Skip to content

Commit

Permalink
exceptions when notFound
Browse files Browse the repository at this point in the history
  • Loading branch information
SaadAissa committed Jul 23, 2024
1 parent a49309b commit f6b68c7
Showing 1 changed file with 30 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,20 +243,39 @@ public CompletableFuture<Response> handle(Command command, Arguments arguments,
if (javaVariable.local != null) {
StackFrameReference stackFrameReference = (StackFrameReference) containerNode.getProxiedVariable();
StackFrame frame = stackFrameManager.getStackFrame(stackFrameReference);
DecodedVariable decodedVariable = stackTraceProvider.decode(javaVariable.local, method, frame.location().lineNumber());
name = decodedVariable.format();
if (name == "") {
// toRemove.add(javaVariable);
continue;
try {
DecodedVariable decodedVariable = stackTraceProvider.decode(javaVariable.local, method, frame.location().lineNumber());
name = decodedVariable.format();
if (name == "") {
// toRemove.add(javaVariable);
continue;
}
} catch (Exception e) {
String notFound = "ch.epfl.scala.decoder.NotFoundException";
String ambiguous = "ch.epfl.scala.decoder.AmbiguousException";
if (e.getMessage().contains(notFound) || e.getMessage().contains(ambiguous)) {
logger.log(Level.INFO, "Failed to decode the variable", e);
} else {
throw e;
}
}
} else
if (javaVariable.field != null) {
DecodedField decodedField = stackTraceProvider.decode(javaVariable.field);
name = decodedField.format();
if (name == "") {
// toRemove.add(javaVariable);
continue;
}
try {
DecodedField decodedField = stackTraceProvider.decode(javaVariable.field);
name = decodedField.format();
if (name == "") {
// toRemove.add(javaVariable);
continue;
}
} catch (Exception e) {
String notFound = "ch.epfl.scala.decoder.NotFoundException";
String ambiguous = "ch.epfl.scala.decoder.AmbiguousException";
if (e.getMessage().contains(notFound) || e.getMessage().contains(ambiguous)) {
logger.log(Level.INFO, "Failed to decode the variable", e);
} else {
throw e;
} }
} else
if (variableNameMap.containsKey(javaVariable)) {
name = variableNameMap.get(javaVariable);
Expand Down

0 comments on commit f6b68c7

Please sign in to comment.