-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Exception in Entry Editor (Braces don't match) #3811
Comments
Thanks for reporting. This is the autosave kicking in that is trying to save the file while the braces are still incomplete. What should be changed here? Should anything be changed? The exception doesn't break anything, JabRef continues to work. And we can't exactly stop the autosave from attempting to save. |
I think the exception should not be shown in this case. It is confusing and might hide other issues (for example, if JabRef hangs and I try to find the reason, I naturally look at the list of exceptions, and having an unrelated exception is distracting). |
Yes I understand and I generally agree, but how should this go about? The autosave saves everything immediately. After adding an opening brace and trying to save, JabRef cannot just swallow the error, because it does not know if the user will ever add a closing brace. And if the user does not do that, then the error message is valid and important. As far as I understand, the solution to your problem is probably to disable autosave. |
We could trigger autosave on field focus change, e.g. When the user leaves the field |
What about replacing jabref/src/main/java/org/jabref/logic/autosaveandbackup/BackupManager.java Lines 125 to 127 in 2cdf085
with } catch (SaveException e) {
LOGGER.error("Error while saving file: " + e.getLocalizedMessage());
} In this way, the stacktrace is not displayed (which is unimportant for these kind of exceptions that are expected to happen to some extend). |
@Siedlerchr The problem in this is that you tie the correctness of the autosave to some future event, which may never be triggered due to exceptional circumstances or could easily be swallowed somewhere else. And you tie the autosave logic to gui events. I am very much in favor of the autosave doing the local decision based on entry events only. I really like the suggestion by @tobiasdiez |
But why show a message at the console at all? Why not just mark the erroneous field with a warning sign (as it is done now)? |
@erelsgl There can be cases where the save fails that is not visible in the entry editor. An example would be that the file to save to is on a network drive that has disappeared in the meantime. In that case, it is good to have a message on the console. I proposed a PR #3865 that skips reporting any invalid field errors during autosave. They no longer make it into the log, but the warning sign stays there. A regular save operation will still trigger the warning dialog. |
Version:
JabRef 4.1
Linux 4.4.0-104-generic amd64
Java 1.8.0_161
Steps to reproduce:
The text was updated successfully, but these errors were encountered: