billputer / go-namecheap

A Go library for using the Namecheap API
MIT License
49 stars 28 forks source link

Handle invalid responses from API #18

Closed jameshartig closed 6 years ago

jameshartig commented 6 years ago

If the API returns a non-200 status with some HTML, then it parses as XML but the resp is unuseable and there is no error so our service is panicking. I added a check for non-200 and a response that contains no status (invalid XML). I also added tests to cover all of these cases.

billputer commented 6 years ago

Looks good to me.