| 1 |
<?php |
| 2 |
namespace Aws\S3\Exception; |
| 3 |
|
| 4 |
use Aws\HasMonitoringEventsTrait; |
| 5 |
use Aws\MonitoringEventsInterface; |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
class DeleteMultipleObjectsException extends \Exception implements |
| 12 |
MonitoringEventsInterface |
| 13 |
{ |
| 14 |
use HasMonitoringEventsTrait; |
| 15 |
|
| 16 |
private $deleted = []; |
| 17 |
private $errors = []; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
public function __construct(array $deleted, array $errors) |
| 24 |
{ |
| 25 |
$this->deleted = array_values($deleted); |
| 26 |
$this->errors = array_values($errors); |
| 27 |
parent::__construct('Unable to delete certain keys when executing a' |
| 28 |
. ' DeleteMultipleObjects request: ' |
| 29 |
. self::createMessageFromErrors($errors)); |
| 30 |
} |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
public static function createMessageFromErrors(array $errors) |
| 40 |
{ |
| 41 |
return "\n- " . implode("\n- ", array_map(function ($key) { |
| 42 |
return json_encode($key); |
| 43 |
}, $errors)); |
| 44 |
} |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
public function getErrors() |
| 53 |
{ |
| 54 |
return $this->errors; |
| 55 |
} |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
public function getDeleted() |
| 65 |
{ |
| 66 |
return $this->deleted; |
| 67 |
} |
| 68 |
} |