Skip to content

RESTClientException triggered from UnkownHostException doesn't tell what's wrong #148

@dhs-rec

Description

@dhs-rec

When executing a REST operation with a wrong hostname, RESTClientException only delivers the hostname, whithout giving any hint as to what's wrong with that host, for example:

try {
  def client = new RESTClient('http://non-existing.example.com')
  def response = client.get(path: '/something', accept: ContentType.JSON) {
    type ContentType.JSON
  }
}
catch (RESTClientException rce) {
  println(rce.message)
}

will only print non-existing.example.com. A more complete message like

Unknown host: non-existing.example.com

would make it more clear what the problem with this host is. One needs to catch java.net.UnknownHostException, though.

This is from version 1.1.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions