feat: propogate errors in Executor

This commit is contained in:
Christy Jacob
2022-02-16 15:43:21 +04:00
parent b6758c1262
commit cef5264c48
3 changed files with 22 additions and 21 deletions
+3 -3
View File
@@ -58,7 +58,7 @@ class Executor
$status = $response['headers']['status-code'];
if ($status >= 400) {
throw new \Exception($response['body'], $status);
throw new \Exception($response['body']['message'], $status);
}
return $response['body'];
@@ -80,7 +80,7 @@ class Executor
$status = $response['headers']['status-code'];
if ($status >= 400) {
throw new \Exception('Error deleting deployment: ' . $deploymentId , $status);
throw new \Exception($response['body']['message'], $status);
}
return $response['body'];
@@ -120,7 +120,7 @@ class Executor
$status = $response['headers']['status-code'];
if ($status >= 400) {
throw new \Exception('Error creating execution: ', $status);
throw new \Exception($response['body']['message'], $status);
}
return $response['body'];