Add more detail for API errors.

We now log debug output for any API errors. The output shows the payload
of the error, making it easier to see what went wrong.

In the case of a failed diff upload, we also include the wrapped error
class's text in the message, instead of the raw error string we get from
the server.