-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Not sure if bug or enhancement.
Problem
Sometimes i forget a comma when editing a bib file.
Sometimes the bib files i get are not formated properly and are missing one or more commas.
When importing such a file in JabRef it leads to a failed import. The error message is very generic and doesn't really help in finding the problem. When opening the file, there is no error, but the library is depicted empty, which does not help finding the problem either.
What to do to replicate:
-
Go to import menu
-
filter for bib files in explorer
-
import the following bib file:
@inproceedings{kroll2013economics, title={The economics of Bitcoin mining, or Bitcoin in the presence of adversaries}, author={Kroll, Joshua A and Davey, Ian C and Felten, Edward W}, booktitle={Proceedings of WEIS}, volume={2013}, pages={11}, year={2013} url={http://www.infosecon.net/workshop/downloads/2013/pdf/The_Economics_of_Bitcoin_Mining,_or_Bitcoin_in_the_Presence_of_Adversaries.pdf} }
Error Message:
Tested with
JabRef 5.4--2021-08-21--644e48d
Windows 10 10.0 amd64
Java 16.0.2
JavaFX 16+8
-
When importing the bib file, the following exception stack trace pops up:
org.jabref.logic.importer.ImportException: Could not find a suitable import format. at org.jabref@5.4.76/org.jabref.logic.importer.ImportFormatReader.importUnknownFormat(Unknown Source) at org.jabref@5.4.76/org.jabref.gui.importer.ImportAction.doImport(Unknown Source) at org.jabref@5.4.76/org.jabref.gui.importer.ImportAction.lambda$automatedImport$1(Unknown Source) at org.jabref@5.4.76/org.jabref.gui.util.BackgroundTask$1.call(Unknown Source) at org.jabref@5.4.76/org.jabref.gui.util.DefaultTaskExecutor$1.call(Unknown Source) at org.jabref.merged.module@5.4.76/javafx.concurrent.Task$TaskCallable.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) -
When opening the library normally, there is no error message. It is just shown to be empty. No message, no error, nothing.
Solution
What JabRef could do to ease the workflow:
- check for missing , (comma) in the bib file during the import or when opening a library. (Prior / After an error message?)
- change the error message to a tooltip to the user (with expandable error log) that asks if any commas are missing in the bibfile?
- give an option to automatically insert commas if an error is encountered (not sure if doable?)
Additional info
The solution could be something similar to what happens when manually editing a file with JabRef in the entry editor.
When deleting a comma of an existing entry in the {}bibtex source frame, the following error message will show up:
I don't really think this is a very nice looking error message, as it makes the user feel as if something terrible just happened and the problem is a VERY SERIOUS CRITICAL ERROR on the part of JabRef, even though it is not JabRef, but the user that might be at fault! At least though, it gives a hint to what happened, where it happened, what the actual problem could be and what JabRef will do.
The following Error message might be easier to understand:
-
When user input via entry editor in
{}bibtex sourcetab:User input via entry-editor in `{}bibtex source` tab led to failure. Please check your library file for wrong syntax. Error occured when parsing entry: Error in line 11 or above: Empty text token. Typical causes: - missing comma between two fields. - ... JabRef skipped the entry. -
When importing library file:
Please check your library file for wrong syntax. Error occured when parsing entry: Error in line 11 or above: Empty text token. Typical causes: - missing comma between two fields. - ... JabRef skipped the entry. -
When opening library file:
Please check your library file for wrong syntax. Error occured when parsing entry: Error in line 11 or above: Empty text token. Typical causes: - missing comma between two fields. - ... JabRef skipped the entry.
