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

Non-200 response throwing MissingPropertyException instead of ResourceDownloadException #257

Open
brockmatt opened this issue Dec 28, 2016 · 0 comments

Comments

@brockmatt
Copy link

It appears that any non-200 response will throw a MissingPropertyException instead of a ResourceDownloadException due to an invalid property reference. The issue can be found on line 121 of ExternalResolver.groovy:

  if(response.statusLine.statusCode != 200) {
    def rde = new ResourceDownloadException("could not get resource $url by HTTP")
    rde.status = status /* MissingPropertyException exception thrown here */
    rde.url = url
    method.releaseConnection()
    throw rde
  }

There is no property status, which causes it to throw the new exception and never set the status code correctly. This effectively means there's no way to catch non-200 responses.

This can be fixed very easily by changing the line to:

rde.status = response.statusLine.statusCode

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

No branches or pull requests

1 participant