fix client toError to use req.url instead of req.path for 5xx and 4xx errors