Ability to pass an instance of IOExceptino to HttpIOExceptionHandler OR log the exception in HttpRequest when HttpTransport.LOGGER level is above CONFIG

Offen
#1,798 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
java
Bereich
api

Rechercherichtung

Beginne in google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java ungefähr bei den Zeilen 891, 1035, 1043 und 127 und lies anschließend die Verwendung von HttpIOExceptionHandler und HttpTransport.LOGGER. Vergleiche die vorgeschlagenen Ansätze für Logging und Handler unter Berücksichtigung der Kompatibilität mit Java 7; abgeschlossen ist die Aufgabe, wenn wiederholbare IOExceptions unabhängig voneinander abgerufen oder protokolliert werden können, ohne das Verhalten des übrigen Loggings zu ändern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

type: feature request

Would it be possible to access or log intermittent/retry-able IO-exceptions of the HttpRequest?

Currently the exception could be logged in https://github.com/googleapis/google-http-java-client/blob/main/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java#L1043, but only when HttpTransport.LOGGER log-level is bellow java.util.logging.Level.CONFIG (https://github.com/googleapis/google-http-java-client/blob/main/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java#L891). Changing that level affects many other logs and so doesn't work when just logging the exceptions is desirable. Would it be possible change the condition for the IOExceptions to be logged, perhaps adding a new flag like intermittentExceptionsLoggingEnabled similar to https://github.com/googleapis/google-http-java-client/blob/main/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java#L127?

Alternatively, instances of the IOException-s could be passed to HttpRequest.ioExceptionHandler in https://github.com/googleapis/google-http-java-client/blob/main/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java#L1035. However, since the project uses Java 7, simply adding an extra method that takes an IOException to HttpIOExceptionHandler with a default implementation would not work. Would it be possible to add a check in https://github.com/googleapis/google-http-java-client/blob/main/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java#L1035 to detect a special handler that accepts IOExceptions or add another handler?

I could send a pull request but probably my solution ideas are not the best.

Vorherrschende Sprache
Java
Sterne
1.4k
Forks
476
Ø Merge
10 Std. 47 Min.
Gemergte PRs (30 T.)
3

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus googleapis/google-http-java-client

Alle Issues in googleapis/google-http-java-client

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.