Change add_error_handling to use a pred rather than status codes

This ticks the third box of #824. It should be reviewed after #833.

This is not yet done. I am starting by only changing the `service_request` (inside `get_request_func`) call site, so that the `request_func` still takes status codes, but internally it uses a predicate. Next step: have the external API also be a predicate.

In that case, the stranded `response` below is not required right? Or it could be moved up to the sentence