Move erroring on request fail to a helper.
Move erroring on request fail to a helper.

So that tests can use it too if they need (for instance checking
data from requests in other threads).

jmorse/cyanide,jmorse/cyanide,jmorse/cyanide,jmorse/cyanide