Error responses are not documented.

  • 1
  • Problem
  • Updated 5 years ago
Are the error responses documented somewhere?

Sometimes there is response.error, other times there is an errors array in the root of the response. It's frustrating trying to handle these cases without knowing what to expect with proper documentation.
Photo of wizdumb

wizdumb

  • 6 Posts
  • 0 Reply Likes
  • frustrated

Posted 6 years ago

  • 1
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 122 Reply Likes
What are some examples you've come across. I don't know that our errors are documented well, so its something we should work on.
Photo of wizdumb

wizdumb

  • 6 Posts
  • 0 Reply Likes
Actually, I retract the part about .errors and error being mismatched. I forgot that I added that in my local proxy which caches the responses. Sorry about that.

Still, the full response formats are undocumented, other than what to expect from each data feature.

The following URL contains:
root.error
root.response
http://api.wunderground.com/api//cond...

A proper query contains:
root.response
root.current_observation (Note that this does not match the requested feature 'conditions' and is undocumented.)
http://api.wunderground.com/api//cond...

In this case, root.error is absent.

Ideally, the API would always return the same format, including root.errors, which would be empty if there were none.
Photo of WeatherInSpace

WeatherInSpace

  • 1 Post
  • 0 Reply Likes
I still do not see any documentation about the formatting of error responses.
I planned on logging these to a file or dispatching an email, but not having them interrupt operation.
From my own experience and from glancing around the forum, all I see is:
error : type
or
error : type, description

Is there at least a 'type' list somewhere?