Skip to content

Commit

Permalink
Merge branch 'MDL-48889-master' of git://github.com/jethac/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Feb 10, 2015
2 parents b7164a5 + 20a263e commit 21c7e25
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions repository/s3/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ public function get_listing($path = '', $page = '') {
try {
$buckets = $this->s->listBuckets();
} catch (S3Exception $e) {
throw new moodle_exception('errorwhilecommunicatingwith', 'repository', '', $this->get_name());
throw new moodle_exception(
'errorwhilecommunicatingwith',
'repository',
'',
$this->get_name(),
$e->getMessage()
);
}
foreach ($buckets as $bucket) {
$folder = array(
Expand All @@ -124,7 +130,13 @@ public function get_listing($path = '', $page = '') {
try {
$contents = $this->s->getBucket($bucket, $uri, null, null, '/', true);
} catch (S3Exception $e) {
throw new moodle_exception('errorwhilecommunicatingwith', 'repository', '', $this->get_name());
throw new moodle_exception(
'errorwhilecommunicatingwith',
'repository',
'',
$this->get_name(),
$e->getMessage()
);
}
foreach ($contents as $object) {

Expand Down Expand Up @@ -199,7 +211,13 @@ public function get_file($filepath, $file = '') {
try {
$this->s->getObject($bucket, $uri, $path);
} catch (S3Exception $e) {
throw new moodle_exception('errorwhilecommunicatingwith', 'repository', '', $this->get_name());
throw new moodle_exception(
'errorwhilecommunicatingwith',
'repository',
'',
$this->get_name(),
$e->getMessage()
);
}
return array('path' => $path);
}
Expand Down

0 comments on commit 21c7e25

Please sign in to comment.