Skip to main content

Reverse Geocode Tool Returns Error When no Address is Found

Comments

3 comments

  • Ryan Cooney

    Hi Matthew,

     

    The ArcGIS REST API typically returns errors as HTTP 200 responses with the response body being a JSON error object. The ArcGIS JavaScript API (which makes the request for the Reverse Geocode activity) inspects all JSON responses for error objects and it throws the error if it sees one.

     

    The Send Web Request activity uses the browser's XHR facility to make the request. It doesn't bother to interpret the content of the response so it will succeed if it is a HTTP 200 response.

     

    You should be able to use a Try Catch activity to capture this in your workflow. That isn't ideal, but it will work.

     

    --Ryan

    0
  • Permanently deleted user

    Thanks for the response Ryan.

     

    I did put it into a try catch then check the exception to make sure it's a 400 "Unable to find address for the specified loation" error. If it isn't I throw an exception again. Everything is working well :)

     

    Even if that^ isn't ideal I'd say it's hard for anyone to decide what to do with the response sent back from the ArcGIS server. For example, The message "Cannot perform query. Invalid query parameters" doesn't make sense since ArcGIS did perform the query and came up with no results.

    0
  • Permanently deleted user

    We should have an update to improve the behaviour for this in version 5.11. The associated bug # to look for in the release notes will be 26158.

    0

Please sign in to leave a comment.