Improve error handling

We now return more detailed error messages when something goes wrong
with curl or the widget is setup wrong.