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

Show solution-oriented user error message when braces don't match #6127

Closed
smartens opened this issue Mar 15, 2020 · 0 comments · Fixed by #6444
Closed

Show solution-oriented user error message when braces don't match #6127

smartens opened this issue Mar 15, 2020 · 0 comments · Fixed by #6444

Comments

@smartens
Copy link

smartens commented Mar 15, 2020

When I accidentally forget to remove a curly brace to remove/set in the entry editor, JabRef should show the user a meaningful error message. Right now only an exception popup is shown with the error message.

image

Steps to reproduce the behavior:

  1. Type in e.g. M{"u}}ller in a field.
  2. Try to save bib file.

I would like to have nice error message displayed when there is the "user"-readable error message here e.g. Error in field 'AUTHOR of entry Vanicek2012': Braces don't match. Field value: J. Van{\'i}}{\v{c}}ek directly presented in the popup. Maybe there could be also an invalid field notification/message so the user is informed before trying to save the file.

Log File
org.jabref.logic.exporter.SaveException: Problems saving:
  at org.jabref/org.jabref.gui.exporter.SaveDatabaseAction.saveDatabase(Unknown Source)
  at org.jabref/org.jabref.gui.exporter.SaveDatabaseAction.doSave(Unknown Source)
  at org.jabref/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source)
  at org.jabref/org.jabref.gui.exporter.SaveDatabaseAction.save(Unknown Source)
  at org.jabref/org.jabref.gui.exporter.SaveAction.execute(Unknown Source)
  at org.jabref/org.jabref.gui.actions.JabRefAction.lambda$new$2(Unknown Source)
  at org.jabref.merged.module/org.controlsfx.control.action.Action.handle(Unknown Source)
  at org.jabref.merged.module/org.controlsfx.control.action.Action.handle(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
  at org.jabref.merged.module/javafx.event.Event.fireEvent(Unknown Source)
  at org.jabref.merged.module/javafx.scene.control.MenuItem.fire(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.scene.control.ControlAcceleratorSupport.lambda$doAcceleratorInstall$1(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.scene.KeyboardShortcutsHandler.processAccelerators(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.scene.KeyboardShortcutsHandler.dispatchBubblingEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
  at org.jabref.merged.module/javafx.event.Event.fireEvent(Unknown Source)
  at org.jabref.merged.module/javafx.scene.Scene$KeyHandler.process(Unknown Source)
  at org.jabref.merged.module/javafx.scene.Scene.processKeyEvent(Unknown Source)
  at org.jabref.merged.module/javafx.scene.Scene$ScenePeerListener.keyEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler$KeyEventNotification.run(Unknown Source)
  at java.base/java.security.AccessController.doPrivileged(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleKeyEvent$1(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
  at org.jabref.merged.module/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleKeyEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.glass.ui.View.handleKeyEvent(Unknown Source)
  at org.jabref.merged.module/com.sun.glass.ui.View.notifyKey(Unknown Source)
  at org.jabref.merged.module/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
  at org.jabref.merged.module/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
  at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Error in field 'AUTHOR of entry Vanicek2012': Braces don't match. Field value: J. Van{\'i}}{\v{c}}ek
  at org.jabref/org.jabref.logic.bibtex.BibEntryWriter.writeField(Unknown Source)
  at org.jabref/org.jabref.logic.bibtex.BibEntryWriter.writeRequiredFieldsFirstRemainingFieldsSecond(Unknown Source)
  at org.jabref/org.jabref.logic.bibtex.BibEntryWriter.write(Unknown Source)
  at org.jabref/org.jabref.logic.exporter.BibtexDatabaseWriter.writeEntry(Unknown Source)
  at org.jabref/org.jabref.logic.exporter.BibDatabaseWriter.savePartOfDatabase(Unknown Source)
  at org.jabref/org.jabref.logic.exporter.BibDatabaseWriter.saveDatabase(Unknown Source)
  ... 42 more
Caused by: org.jabref.logic.bibtex.InvalidFieldValueException: Braces don't match. Field value: J. Van{\'i}}{\v{c}}ek
  at org.jabref/org.jabref.logic.bibtex.FieldWriter.checkBraces(Unknown Source)
  at org.jabref/org.jabref.logic.bibtex.FieldWriter.formatAndResolveStrings(Unknown Source)
  at org.jabref/org.jabref.logic.bibtex.FieldWriter.write(Unknown Source)
  ... 48 more

JabRef 5.1--2020-03-12--23034ce
Windows 10 10.0 amd64
Java 13.0.2

✔️ I have tested the latest development version from http://builds.jabref.org/master/ and the problem persists

chenyuheng added a commit to chenyuheng/jabref that referenced this issue May 7, 2020
add concise tips when SaveException happend
Siedlerchr pushed a commit that referenced this issue May 8, 2020
* fix #6127

add concise tips when SaveException happend

* Update SaveDatabaseAction.java

add space...
dextep pushed a commit to dextep/jabref that referenced this issue May 8, 2020
* fix JabRef#6127

add concise tips when SaveException happend

* Update SaveDatabaseAction.java

add space...
koppor pushed a commit that referenced this issue Jul 15, 2022
39fede5 Update associacao-brasileira-de-normas-tecnicas.csl (#6138)
fde7695 Include chapter title (#6140)
1e3d8b4 Update n.d. abbreivation for DGP style (#6136)
ebb728b suffix '.' after first group; changed e-mail (#6135)
eed4f07 Update and rename sciences-po-ecole-doctorale-note-french.csl to scie… (#6127)
f194647 Delete TU Dresden Medizin as requested by library (#6131)
d8423d8 Create entomological-review.csl (#6120)
064a394 Create australasian-journal-of-philosophy.csl (#6063)
a998ded Add composer.json (#5668)
37083c9 Update copernicus-publications.csl (#6062)
694c97b Create chaucer review (#6061)
625a424 Create haffner-style-manual.csl (#6054)
8b7224b make annals-of-allergy-asthma-and-immunology independent (#6041)
710748c Create university-of-pretoria-harvard-theology-religion.csl (#6106)
d16dffd Create health-physics.csl (#6040)
ca9e184 Update style-manual-australian-government.csl (#6119)
e412277 Create chemical-engineering-technology.csl (#6039)
bebdb48 Create bibliothek-forschung-und-praxis.csl (#6038)
29e49cd Update nature.csl (#6117)
891897d fix short title for SBL (#6118)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: 39fede5
koppor pushed a commit that referenced this issue Aug 1, 2022
c750b6e APA: Put conditional event-title logic in a macro (#6161)
a87414f Remove month from association-for-compuational-linguistics.csl (#6158)
6153db0 Remove issue numbers from BJOC style (#6155)
e231ea3 Bug fix for `event` regression (#6154)
0dab651 Add event-title to other APA styles (#6153)
698cf1c APA: `event-title` and conditional `event` (#6152)
58d3f8f Update vancouver-author-date.csl (#6148)
f1638a9 add substitute to Vancouver author date (#6147)
39fede5 Update associacao-brasileira-de-normas-tecnicas.csl (#6138)
fde7695 Include chapter title (#6140)
1e3d8b4 Update n.d. abbreivation for DGP style (#6136)
ebb728b suffix '.' after first group; changed e-mail (#6135)
eed4f07 Update and rename sciences-po-ecole-doctorale-note-french.csl to scie… (#6127)
f194647 Delete TU Dresden Medizin as requested by library (#6131)
d8423d8 Create entomological-review.csl (#6120)
064a394 Create australasian-journal-of-philosophy.csl (#6063)
a998ded Add composer.json (#5668)
37083c9 Update copernicus-publications.csl (#6062)
694c97b Create chaucer review (#6061)
625a424 Create haffner-style-manual.csl (#6054)
8b7224b make annals-of-allergy-asthma-and-immunology independent (#6041)
710748c Create university-of-pretoria-harvard-theology-religion.csl (#6106)
d16dffd Create health-physics.csl (#6040)
ca9e184 Update style-manual-australian-government.csl (#6119)
e412277 Create chemical-engineering-technology.csl (#6039)
bebdb48 Create bibliothek-forschung-und-praxis.csl (#6038)
29e49cd Update nature.csl (#6117)
891897d fix short title for SBL (#6118)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: c750b6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants