Including Tests and verifications for errors

This commit is contained in:
2019-06-27 20:03:10 -03:00
parent e4f2bd04be
commit aaabb91039
10 changed files with 221 additions and 9 deletions

View File

@@ -23,6 +23,10 @@ class Jobs extends \BrunoFontes\Memsource\BaseApi
public function list(string $projectUid, array $parameters = []): string
{
$url = "/api2/v2/projects/{$projectUid}/jobs";
return $this->fetchApi->fetch('get', $url, $parameters);
$response = $this->fetchApi->fetch('get', $url, $parameters);
if ($this->hasError($response)) {
throw new \Exception("Error listing projects: " . $this->getError($response), 1);
}
return $response;
}
}