Skip to content

Conversation

@jorgee
Copy link
Contributor

@jorgee jorgee commented Jul 24, 2025

close #3
The current implementation assumes the request will return an HTTP response with an ErrorResponse serialized as JSON, but this only happens when the publish registry URL is correct. In other cases, the error response is null or throws a JSONParseException, hiding the real reason for the error.

This PR fixes this incorrect behaviour by checking the response content.

  • If content matches with ErrorResponse, the message includes HTTP code, error type, and message
  • If content doesn't match with ErrorResponse, the message includes the HTTP code and the content string
  • If there is no content, it just returns the HTTP code

jorgee added 2 commits July 24, 2025 09:10
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
@jorgee jorgee requested a review from pditommaso July 24, 2025 08:35
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
@jorgee jorgee merged commit 0da9762 into master Jul 24, 2025
@jorgee jorgee deleted the fix-3-NPE branch July 24, 2025 17:50
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.

NPE when publishing to an incorrect URL

3 participants