Skip to content

Commit 0060d89

Browse files
committed
Merge pull request #25 from beaubbe/integration
Added method for when http error
2 parents 0e81568 + cc9b426 commit 0060d89

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,14 @@ public static function prepareGateway(&$gateway) {}
3535
* the parsed xml string data returned by the Gateway by reference
3636
*/
3737
public function exposeData(&$data) {}
38+
39+
/**
40+
* This method is called when their is an http error
41+
* or when content type is unsupported
42+
*
43+
* @since Remote Datasource 2.0
44+
* @param array $info
45+
* info of the http request
46+
*/
47+
public function httpError(&$info) {}
3848
````

data-sources/datasource.remote.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,19 @@ public static function prepareGateway(&$gateway)
6969
public function exposeData(&$data)
7070
{
7171

72+
}
73+
74+
/**
75+
* This method is called when their is an http error
76+
* or when content type is unsupported
77+
*
78+
* @since Remote Datasource 2.0
79+
* @param array $info
80+
* info of the http request
81+
*/
82+
public function httpError(&$info)
83+
{
84+
7285
}
7386

7487
/*-------------------------------------------------------------------------
@@ -678,6 +691,8 @@ public function execute(array &$param_pool = null)
678691
$writeToCache = false;
679692

680693
$result->setAttribute('valid', 'false');
694+
695+
$this->httpError($info);
681696

682697
// 28 is CURLE_OPERATION_TIMEOUTED
683698
if ($info['curl_error'] == 28) {

0 commit comments

Comments
 (0)