add try catch

This commit is contained in:
林万程
2023-06-13 07:45:15 +08:00
parent 2c6f96712b
commit 83e0a0a5ee
13 changed files with 138 additions and 20 deletions

View File

@@ -18,14 +18,26 @@ import io.github.linwancen.plugin.show.lang.base.BaseLangDoc;
import io.github.linwancen.plugin.show.settings.AppSettingsState;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Collection;
import java.util.List;
public class Tree implements ProjectViewNodeDecorator {
private static final Logger LOG = LoggerFactory.getLogger(Tree.class);
@Override
public void decorate(@NotNull ProjectViewNode node, @NotNull PresentationData data) {
try {
decorateImpl(node, data);
} catch (Throwable e) {
LOG.info("Tree catch Throwable but log to record.", e);
}
}
private void decorateImpl(@NotNull ProjectViewNode node, @NotNull PresentationData data) {
if (!AppSettingsState.getInstance().showTreeComment) {
return;
}