whosonfirst / deprecated-go-whosonfirst-clone

Tools and libraries for cloning (not syncing) Who's on First data to your local machine.
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Server error replaces file contents with XML error response #6

Closed trescube closed 9 years ago

trescube commented 9 years ago

I tried running the utility but it appears that when the server returns an error, XML is dropped into the geojson file:

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InternalError</Code><Message>We encountered an internal error. Please try again.</Message><RequestId>869BD31C5B34FB96</RequestId><HostId>a4U+mbECCoUshCCDsl94BQXPsQfR6N/rW0PtscnjerPU3nGzsv4nNPCFwEtkydy+fNPghHOxvKE=</HostId></Error>%
thisisaaronland commented 9 years ago

Beauty...

On Mon, Nov 9, 2015 at 12:01 PM, Stephen K Hess notifications@github.com wrote:

I tried running the utility but it appears that when the server returns an error, XML is dropped into the geojson file:

<?xml version="1.0" encoding="UTF-8"?>

InternalErrorWe encountered an internal error. Please try again.869BD31C5B34FB96a4U+mbECCoUshCCDsl94BQXPsQfR6N/rW0PtscnjerPU3nGzsv4nNPCFwEtkydy+fNPghHOxvKE=% — Reply to this email directly or view it on GitHub https://github.com/whosonfirst/go-whosonfirst-clone/issues/6.
thisisaaronland commented 9 years ago

Oh there's the problem:

https://github.com/whosonfirst/go-whosonfirst-clone/blob/master/clone.go#L271-L279

I guess I just got used to Python freaking out and blowing its brains out when it encounters a not-200 status code. I will update accordingly...