Skip to content

Commit c140561

Browse files
Log the logical structure evaluation error (#266)
Signed-off-by: Jinbo Wang <[email protected]>
1 parent 900bfbe commit c140561

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/VariablesRequestHandler.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@
2121
import java.util.Set;
2222
import java.util.concurrent.CompletableFuture;
2323
import java.util.concurrent.ExecutionException;
24+
import java.util.logging.Level;
25+
import java.util.logging.Logger;
2426
import java.util.stream.Collectors;
2527

2628
import org.apache.commons.lang3.StringUtils;
2729

30+
import com.microsoft.java.debug.core.Configuration;
2831
import com.microsoft.java.debug.core.DebugSettings;
2932
import com.microsoft.java.debug.core.adapter.AdapterUtils;
3033
import com.microsoft.java.debug.core.adapter.ErrorCode;
@@ -57,6 +60,7 @@
5760
import com.sun.jdi.Value;
5861

5962
public class VariablesRequestHandler implements IDebugRequestHandler {
63+
protected static final Logger logger = Logger.getLogger(Configuration.LOGGER_NAME);
6064

6165
@Override
6266
public List<Command> getTargetCommands() {
@@ -141,7 +145,10 @@ public CompletableFuture<Response> handle(Command command, Arguments arguments,
141145
}
142146
}
143147
} catch (InterruptedException | ExecutionException e) {
144-
// do nothing.
148+
logger.log(Level.WARNING,
149+
String.format("Failed to get the logical structure for the type %s, fall back to the Object view.",
150+
containerObj.type().name()),
151+
e);
145152
}
146153
}
147154
}
@@ -217,7 +224,8 @@ public CompletableFuture<Response> handle(Command command, Arguments arguments,
217224
indexedVariables = ((IntegerValue) size).value();
218225
}
219226
} catch (InterruptedException | ExecutionException e) {
220-
// do nothing.
227+
logger.log(Level.INFO,
228+
String.format("Failed to get the logical size for the type %s.", value.type().name()), e);
221229
}
222230
}
223231
}

0 commit comments

Comments
 (0)