Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loss of error info in UrlConnectionException #2648

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

weiminyu
Copy link
Collaborator

@weiminyu weiminyu commented Jan 22, 2025

It does not get the error message for 400+ status codes.

It fails to get the status code if the response has neither data nor error.


This change is Reviewable

@weiminyu weiminyu requested a review from jianglai January 22, 2025 19:55
It does not get the error message for 400+ status codes.

It fails to get the status code if the response has neither data nor
error.
Copy link
Collaborator

@jianglai jianglai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description should say what the PR does, not describe a problem.

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @weiminyu)


util/src/main/java/google/registry/util/UrlConnectionException.java line 47 at r1 (raw file):

              responseCode < 400 ? connection.getInputStream() : connection.getErrorStream());
    } catch (IOException | NullPointerException e) {
      resultContent = "-- Response is missing or has malformed content --".getBytes(UTF_8);

Is the content malformed? It is more like non-existent,right?

Copy link
Collaborator Author

@weiminyu weiminyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jianglai)


util/src/main/java/google/registry/util/UrlConnectionException.java line 47 at r1 (raw file):

Previously, jianglai (Lai Jiang) wrote…

Is the content malformed? It is more like non-existent,right?

'is missing or has malformed'. The latter would be the cause of an IOException.

@weiminyu weiminyu changed the title UrlConnectionException loses error info Fix loss of error info in UrlConnectionException Jan 22, 2025
Copy link
Collaborator Author

@weiminyu weiminyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jianglai)

@weiminyu weiminyu requested a review from jianglai January 22, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants