Skip to content

Commit

Permalink
Add some debug
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Aug 12, 2024
1 parent 7801226 commit 5623b57
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/org/jabref/logic/importer/FetcherException.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jabref.logic.importer;

import java.io.IOException;
import java.net.URL;
import java.util.Optional;
import java.util.regex.Pattern;
Expand All @@ -9,7 +10,11 @@
import org.jabref.logic.l10n.Localization;
import org.jabref.model.strings.StringUtil;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class FetcherException extends JabRefException {
private static final Logger LOGGER = LoggerFactory.getLogger(FetcherException.class);

Pattern API_KEY_PATTERN = Pattern.compile("(?i)(api|key|api[-_]?key)=[^&]*");

Expand Down Expand Up @@ -63,7 +68,13 @@ public FetcherException(String errorMessage, Throwable cause) {
// TODO: Convert IOException e to FetcherClientException
// Same TODO as in org.jabref.logic.importer.EntryBasedParserFetcher.performSearch.
// Maybe do this in org.jabref.logic.importer.FetcherException.getLocalizedMessage

// Idea (fromorg.jabref.logic.importer.fetcher.GoogleScholar.performSearchPaged)
// if (e.getMessage().contains("Server returned HTTP response code: 503 for URL")) {
super(errorMessage, cause);
if (LOGGER.isDebugEnabled() && (cause instanceof IOException)) {
LOGGER.debug("I/O excpetion", cause);
}
httpResponse = null;
url = null;
}
Expand Down

0 comments on commit 5623b57

Please sign in to comment.