-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Improve error handling on GROBID server connection issues #7026
Improve error handling on GROBID server connection issues #7026
Conversation
add information on GROBID server connection issue for user relates to JabRef#6517 and JabRef#6891
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your PR. The code looks already very good. I've a few minor remarks. Could you please address them?
@@ -58,6 +64,16 @@ public StringProperty inputTextProperty() { | |||
public void startParsing() { | |||
BackgroundTask.wrap(() -> currentCitationfetcher.performSearch(inputTextProperty.getValue())) | |||
.onRunning(() -> dialogService.notify(Localization.lang("Your text is being parsed..."))) | |||
.onFailure((e) -> { | |||
if (e instanceof UncheckedIOException) { | |||
String msg = Localization.lang("There are connection issues with the %0 server. Detailed information: %1.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not so important for the user which exact url failed (especially since the popup disappears to quickly to type it in the url of a webbrower to check). So I suggest the following wording: "Could not connect to JabRef server (Connection timed out)."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe add the details via error log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point, @tobiasdiez.
This should be "Could not connect to GROBID server (Connection timed out)." Shouldn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still say "JabRef server"...the user knows what Jabref is, but not necessarily what grobid is. I would see this also as an "implementation detail", maybe in the future we switch the backend from grobid to something else..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was tricky to get the Message to a phrase as you proposed.
I reduced the level of detail towards:
"There are connection issues with a JabRef server. Detailed information: %0."
Is this OK for you @tobiasdiez ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Thanks
src/main/java/org/jabref/logic/importer/fetcher/GrobidCitationFetcher.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jabref/logic/importer/fetcher/GrobidCitationFetcherTest.java
Outdated
Show resolved
Hide resolved
use assertThrow is more convenient
reduce detail level from user message rework to use FetcherException instead of UncheckedIOException
All reviews incorporated. /cc @tobiasdiez |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the quick follow-up! From my side, this is now good to go. We have the convention that at least two core developers have to approve a PR, so please have a bit of patience until the second review arrives.
@koppor The author check fails again...should we disable it again?
Thank you very much, @tobiasdiez |
The PR wil count towards hacktoberfest because we applied the hacktoberfest label on the repo. |
Thanks for your contribution! Looking foward seeing more from you ;) |
Hi,
This PR relates to issues #6517 and #6891.
It's more improvement than an actual fix because the root cause is: the server is not available (which I can't fix).
Motivation:
When I read #6517 and #6891, I realized, that these were reported by 'power users',
means people who e.g. understand how to activate debug logging.
When I tried to reproduce the issues, I realized, that for the end-users the issue is not transparent.
Additionally, on my OSX, the Java 14 runtime has an infinite connect timeout set, so I never got a visual response on my action (refers to "New entry from plain text" button)
What I changed:
I hope, with this new behavior, users will better understand, why this feature does not work as expected.
Any feedback welcome.