summaryrefslogtreecommitdiff
path: root/app/Job
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2018-03-02 12:05:41 -0800
committerFrédéric Guillot <fred@kanboard.net>2018-03-02 12:05:41 -0800
commitebe04e672c7982a1560133ee87f417560a851a10 (patch)
tree459c4fd52f85e9f9032c9e3ec7e178e032a8c8c5 /app/Job
parent94ed32dedfeb32d8b89f457bae749fbec16fd9b0 (diff)
Improve HTTP client to raise exceptions
Diffstat (limited to 'app/Job')
-rw-r--r--app/Job/HttpAsyncJob.php10
1 files changed, 6 insertions, 4 deletions
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);
}
}