Skip to content
Snippets Groups Projects
Commit 06837423 authored by Yas Naoi's avatar Yas Naoi
Browse files

Issue #2736821: aws_cloud - Added error handling during an operation

parent ffce0d17
No related branches found
No related tags found
No related merge requests found
<?php <?php
// Updated by yas 2016/09/07
// Updated by yas 2016/09/06 // Updated by yas 2016/09/06
// Updated by yas 2016/09/05 // Updated by yas 2016/09/05
// Updated by yas 2016/09/04 // Updated by yas 2016/09/04
...@@ -493,32 +494,30 @@ exit; ...@@ -493,32 +494,30 @@ exit;
$result = $ec2_client->execute($command); $result = $ec2_client->execute($command);
} }
// $command = $ec2_client->getCommand($operation, $params);
// print "passed 3: " . var_dump($command) . "<br />";
// @TODO: for debug, therefore clean up the following line later
// print "passed 4: $operation<br />";
// $result = $ec2_client->execute($command);
return $result; return $result;
} }
catch (Ec2Exception $e) { catch (Ec2Exception $e) {
print "ApiController::execute - passed 5: $operation"; $status = 'error';
// var_dump($e); $message = $this->t('Error: The operation "@operation" couldn\'t be performed.', [
print '<br />Response: '; '@operation' => $operation,
print_r($e->getResponse()); ]);
print '<br />Status Result: '; drupal_set_message($message, $status);
print_r($e->getResult());
print '<br />Status Code: '; $message = $this->t('Error Info: @error_info', [
print_r($e->getStatusCode()); '@error_info' => $e->getAwsErrorCode(),
print '<br />AWS Error Type: '; ]);
print_r($e->getAwsErrorType()); drupal_set_message($message, $status);
print '<br />AWS Error Code: ';
print_r($e->getAwsErrorCode()); $message = $this->t('Error from: @error_type-side', [
print '<br />Transfer Info: '; '@error_type' => $e->getAwsErrorType(),
print_r($e->getTransferInfo()); ]);
exit; drupal_set_message($message, $status);
$message = $this->t('Status Code: @status_code', [
'@status_code' => $e->getStatusCode(),
]);
drupal_set_message($message, $status);
} }
return NULL; return NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment