When an error occurs at the server site (eg: calling the commercial web-service without a valid account) some error XML is returned:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<geonames>
<status message="Please provide a valid username for the commercial GeoNames web service or use the free ws.geonames.org server. Thank you for your understanding." value="10"/>
</geonames>
This message is not returned to the user.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | geonames.status.patch | 690 bytes | lyricnz |
Comments
Comment #1
lyricnz commentedThere is some code that looks like it intended to handle this case:
but this doesn't work because $xml->status is not an array but a SimpleXMLElement.
Comment #2
lyricnz commentedTo check for the existence of a child, typecast it to a bool. Here's a patch that does that.
Comment #3
lyricnz commentedApplied.