Add request error handler

Don't fail silently if the HTTP request fails for whatever reasons.