From ebe04e672c7982a1560133ee87f417560a851a10 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 2 Mar 2018 12:05:41 -0800 Subject: Improve HTTP client to raise exceptions --- app/Job/HttpAsyncJob.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'app/Job') diff --git a/app/Job/HttpAsyncJob.php b/app/Job/HttpAsyncJob.php index f2e9b3f5..9e1ffb61 100644 --- a/app/Job/HttpAsyncJob.php +++ b/app/Job/HttpAsyncJob.php @@ -18,11 +18,12 @@ class HttpAsyncJob extends BaseJob * @param string $url * @param string $content * @param array $headers + * @param bool $raiseForErrors * @return $this */ - public function withParams($method, $url, $content, array $headers) + public function withParams($method, $url, $content, array $headers, $raiseForErrors = false) { - $this->jobParams = array($method, $url, $content, $headers); + $this->jobParams = array($method, $url, $content, $headers, $raiseForErrors); return $this; } @@ -34,9 +35,10 @@ class HttpAsyncJob extends BaseJob * @param string $url * @param string $content * @param array $headers + * @param bool $raiseForErrors */ - public function execute($method, $url, $content, array $headers) + public function execute($method, $url, $content, array $headers, $raiseForErrors = false) { - $this->httpClient->doRequest($method, $url, $content, $headers); + $this->httpClient->doRequest($method, $url, $content, $headers, $raiseForErrors); } } -- cgit v1.2.3