You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the Shodan HTTP API returns an error status code, such as 403 Forbidden, this library will only return a APIError object.
However, the HTTP response will usually also include data in the response body, such as {"error": "Requires membership or higher to access"}. This data is currently ignored and not available through the library.
It would be useful if this response body is also made available by the library, for example to show a more informative error message to the end user.
The text was updated successfully, but these errors were encountered:
The contents of the APIException.value property are hardcoded in the library, so e.g. for status code 403 the error message will always be Access denied (403 Forbidden):
I think that's because for some of those responses the body isn't JSON but you're right, we should use the JSON error message if available as that is typically more precise.
When the Shodan HTTP API returns an error status code, such as 403 Forbidden, this library will only return a
APIError
object.However, the HTTP response will usually also include data in the response body, such as
{"error": "Requires membership or higher to access"}
. This data is currently ignored and not available through the library.It would be useful if this response body is also made available by the library, for example to show a more informative error message to the end user.
The text was updated successfully, but these errors were encountered: