googleapis / googleapis/google-http-java-client
Ability to pass an instance of IOExceptino to HttpIOExceptionHandler OR log the exception in HttpRequest when HttpTransport.LOGGER level is above CONFIG
- 主要言語
- Java
- スター
- 1.4k
- フォーク
- 473
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.
コントリビューションガイド
評価
この issue はまだ評価されていません。