Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uncaught exception message #4565

Merged
merged 4 commits into from
Jan 5, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where only one PDF file could be imported [#4422](https://github.com/JabRef/jabref/issues/4422)
- We fixed an issue where "Move to group" would always move the first entry in the library and not the selected [#4414](https://github.com/JabRef/jabref/issues/4414)
- We fixed an issue where an older dialog appears when downloading full texts from the quality menu. [#4489](https://github.com/JabRef/jabref/issues/4489)

- We fixed an issue where uncaught exceptions were logged but the user wasn't informed about their occurance. [#2288] (https://github.com/JabRef/jabref/issues/2288)



Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/jabref/FallbackExceptionHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.jabref;

import org.jabref.gui.fallbackerror.FallbackErrorView;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -17,5 +19,6 @@ public static void installExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable exception) {
LOGGER.error("Uncaught exception occurred in " + thread, exception);
new FallbackErrorView().show();
Le-wi marked this conversation as resolved.
Show resolved Hide resolved
}
}
17 changes: 17 additions & 0 deletions src/main/java/org/jabref/gui/fallbackerror/FallbackError.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.ButtonType?>
<?import javafx.scene.control.DialogPane?>
<?import javafx.scene.control.Label?>
<DialogPane xmlns="http://javafx.com/javafx/8.0.60"
xmlns:fx="http://javafx.com/fxml/1" prefHeight="150.0" prefWidth="325.0"
fx:controller="org.jabref.gui.fallbackerror.FallbackErrorView">
<content>
<Label prefWidth="300" wrapText="true" text="%An uncaught exception occurred. Please check the logfiles for more details."/>
</content>
<header>
</header>
<buttonTypes>
<ButtonType fx:constant="CLOSE"/>
</buttonTypes>
</DialogPane>
17 changes: 17 additions & 0 deletions src/main/java/org/jabref/gui/fallbackerror/FallbackErrorView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.jabref.gui.fallbackerror;

import org.jabref.gui.util.BaseDialog;
import org.jabref.logic.l10n.Localization;

import com.airhacks.afterburner.views.ViewLoader;

public class FallbackErrorView extends BaseDialog<Void> {

public FallbackErrorView() {
this.setTitle(Localization.lang("Unexpected error"));

ViewLoader.view(this)
.load()
.setAsDialogPane(this);
}
}
3 changes: 2 additions & 1 deletion src/main/resources/l10n/JabRef_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2201,5 +2201,6 @@ Write\ XMP-metadata\ to\ PDFs=&XMP-Metadaten in PDFs schreiben

Override\ default\ font\ settings=Standardschrifteinstellungen überschreiben


An\ uncaught\ exception\ occurred.\ Please\ check\ the\ logfiles\ for\ more\ details.=Ein unerwarteter Fehler ist aufgetreten. Details finden sich in den Logfiles.
Unexpected\ error=Unerwarteter Fehler

3 changes: 3 additions & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2245,3 +2245,6 @@ Main\ layout\ file=Main layout file
Save\ exporter=Save exporter
File\ extension\:=File extension\:
Export\ format\ name\:=Export format name\:

An\ uncaught\ exception\ occurred.\ Please\ check\ the\ logfiles\ for\ more\ details.=An uncaught exception occurred. Please check the logfiles for more details.
Unexpected\ error=Unexpected error