diff --git a/CHANGELOG.md b/CHANGELOG.md index e09adc83e2f..55d21265e7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We added a DOI format and organization check to detect [American Physical Society](https://journals.aps.org/) journals to copy the article ID to the page field for cases where the page numbers are missing. [#7019](https://github.com/JabRef/jabref/issues/7019) - We added a new fetcher to enable users to search jstor.org [#6627](https://github.com/JabRef/jabref/issues/6627) +- We added an error message in the New Entry dialog that is shown in case the fetcher did not find anything . [#7000](https://github.com/JabRef/jabref/issues/7000) ### Changed diff --git a/src/main/java/org/jabref/gui/EntryTypeViewModel.java b/src/main/java/org/jabref/gui/EntryTypeViewModel.java index c2d055c08bb..21f60791931 100644 --- a/src/main/java/org/jabref/gui/EntryTypeViewModel.java +++ b/src/main/java/org/jabref/gui/EntryTypeViewModel.java @@ -176,6 +176,10 @@ public void runFetcherWorker() { searchSuccesfulProperty.set(true); } else if (StringUtil.isBlank(idText.getValue())) { dialogService.showWarningDialogAndWait(Localization.lang("Empty search ID"), Localization.lang("The given search ID was empty.")); + } else if (result.isEmpty()) { + String fetcher = selectedItemProperty().getValue().getName(); + String searchId = idText.getValue(); + dialogService.showErrorDialogAndWait(Localization.lang("Fetcher '%0' did not find an entry for id '%1'.", fetcher, searchId)); } fetcherWorker = new FetcherWorker(); diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaOttoBibFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaOttoBibFetcher.java index 28402523e19..30e6f8513ff 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaOttoBibFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaOttoBibFetcher.java @@ -58,6 +58,13 @@ public Optional performSearchById(String identifier) throws FetcherExc throw new FetcherException("Could not ", e); } Element textArea = html.select("textarea").first(); + + // inspect the "no results" error message (if there is one) + Optional potentialErrorMessageDiv = Optional.ofNullable((html.select("div#flash-notice.notice.add-bottom").first())); + if (potentialErrorMessageDiv.isPresent() && potentialErrorMessageDiv.get().text().contains("No Results")) { + LOGGER.error("ISBN {} not found at ottobib", identifier); + } + Optional entry = Optional.empty(); try { entry = BibtexParser.singleFromString(textArea.text(), importFormatPreferences, new DummyFileUpdateMonitor());