mozilla/browserid — pull request #3862 by jrgm (2013-09-06 01:38:56+00:00)
Title: [load_gen] improve details on failures to show original request and response code and body

When running load_gen, there are occasionally errors reported, which I'm pretty sure are database replication races. I don't believe that these actually happen in production (for the most part). The load_gen tool inherently does sequences of wsapi calls that a real user would never perform at the same speed.

However, the errors are reported with so little detail that it's not possible to trace them. So this PR increases the errors to always show the response code and body, and the request method, host and URI.

Before:

error: (signup) responseNotOk: non 200 response code: 400
error: (signup) unknown: null response body

After:

error: (signup) responseNotOk: non 200 response code >>> {"code":400,"body":"Bad Request: that email does not belong to you","req":{"method":"POST","host":"login.anosrep.org","path":"/wsapi/cert_key"}}
error: (signup) responseNotOk: non 200 response code >>> {"code":400,"body":"","req":{"method":"GET","host":"login.anosrep.org","path":"/wsapi/fake_verification?email=foo%40loadtest.domain"}}