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
// Updated by yas 2016/09/07
// Updated by yas 2016/09/06
// Updated by yas 2016/09/05
// Updated by yas 2016/09/04
......@@ -493,32 +494,30 @@ exit;
$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;
}
catch (Ec2Exception $e) {
print "ApiController::execute - passed 5: $operation";
// var_dump($e);
print '<br />Response: ';
print_r($e->getResponse());
print '<br />Status Result: ';
print_r($e->getResult());
print '<br />Status Code: ';
print_r($e->getStatusCode());
print '<br />AWS Error Type: ';
print_r($e->getAwsErrorType());
print '<br />AWS Error Code: ';
print_r($e->getAwsErrorCode());
print '<br />Transfer Info: ';
print_r($e->getTransferInfo());
exit;
$status = 'error';
$message = $this->t('Error: The operation "@operation" couldn\'t be performed.', [
'@operation' => $operation,
]);
drupal_set_message($message, $status);
$message = $this->t('Error Info: @error_info', [
'@error_info' => $e->getAwsErrorCode(),
]);
drupal_set_message($message, $status);
$message = $this->t('Error from: @error_type-side', [
'@error_type' => $e->getAwsErrorType(),
]);
drupal_set_message($message, $status);
$message = $this->t('Status Code: @status_code', [
'@status_code' => $e->getStatusCode(),
]);
drupal_set_message($message, $status);
}
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