Skip to content

Commit 4266f74

Browse files
authored
Merge pull request #64 from adangel/log-exceptions
Log exceptions
2 parents f3211df + e4f0400 commit 4266f74

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
**Fixed issues:**
88

99
* [#61](https://github.com/pmd/pmd-designer/issues/61) Remove dependency to jcommander
10+
* [#62](https://github.com/pmd/pmd-designer/issues/62) Exceptions and errors are not always logged
1011
* [#63](https://github.com/pmd/pmd-designer/issues/63) Update to PMD 7.0.0-rc3
1112

1213
**Merged pull requests:**

src/main/java/net/sourceforge/pmd/util/fxdesigner/app/ApplicationComponent.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
package net.sourceforge.pmd.util.fxdesigner.app;
66

7+
import static net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil.printShortStackTrace;
8+
79
import java.util.function.Supplier;
810

911
import org.checkerframework.checker.nullness.qual.NonNull;
@@ -143,6 +145,7 @@ default void raiseParsableSourceFlag(Supplier<String> details) {
143145

144146
/** Logs an exception that occurred somewhere in the app logic. */
145147
default void logInternalException(Throwable throwable) {
148+
printShortStackTrace(throwable);
146149
if (isDeveloperMode()) {
147150
System.err.println("Exception in " + this.getDebugName() + ": " + throwable.getMessage());
148151
System.err.println(" See the event log for more info");

src/main/java/net/sourceforge/pmd/util/fxdesigner/app/NodeSelectionSource.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
package net.sourceforge.pmd.util.fxdesigner.app;
66

7-
import static net.sourceforge.pmd.util.fxdesigner.util.DesignerUtil.printShortStackTrace;
8-
97
import java.util.Objects;
108

119
import org.reactfx.EventStream;
@@ -78,7 +76,6 @@ default Val<Node> initNodeSelectionHandling(DesignerRoot root,
7876
Platform.runLater(() -> setFocusNode(evt.selected, evt.options));
7977
} catch (Exception e) {
8078
logInternalException(e);
81-
printShortStackTrace(e);
8279
// don't rethrow so that an error by one source doesn't affect others
8380
}
8481
});

src/main/java/net/sourceforge/pmd/util/fxdesigner/app/services/ASTManagerImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ public ASTManagerImpl(DesignerRoot owner) {
129129
updated = null;
130130
currentException.setValue(e);
131131
} catch (LinkageError e) {
132+
// LinkageErrors might occur due to API incompatibilities with pmd-core at runtime.
132133
updated = null;
134+
logInternalException(e);
133135
}
134136

135137
compilationUnit.setValue(updated);

0 commit comments

Comments
 (0)