Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b2d70f6
multipart uploader method
cintiashamsu Apr 17, 2023
51f7574
update displayProgress method
cintiashamsu Apr 17, 2023
5cb12d5
removed comments
cintiashamsu Apr 17, 2023
ebd06c4
added ability to display progressBar for MultipartUpload and Multipar…
cintiashamsu Apr 19, 2023
6dc3597
Update UploadState.php
cintiashamsu Apr 19, 2023
7f05ff1
Update AbstractUploader.php
cintiashamsu Apr 19, 2023
657ab9a
MultipartUploader and MultipartCopy now sends total size directly to …
cintiashamsu Apr 19, 2023
89c9513
Update UploadStateTest.php
cintiashamsu Apr 24, 2023
d68597c
Added assert using expectOutputString and structure for data provider
cintiashamsu Apr 24, 2023
99738f8
added two tests
cintiashamsu Apr 26, 2023
604df58
Update UploadState.php
cintiashamsu Apr 26, 2023
12e328d
Update UploadStateTest.php
cintiashamsu Apr 28, 2023
e42ab91
Update UploadStateTest.php
cintiashamsu May 1, 2023
470627a
Combine progressThresholds and progressBar into one array
cintiashamsu May 1, 2023
8cfe7e9
Updated displayProgress to use progressBar
cintiashamsu May 1, 2023
9ade473
Update UploadState.php
cintiashamsu May 2, 2023
74e7938
added exceptions for non-int arguments
cintiashamsu May 3, 2023
5eded67
Added unit tests for failed upload and type checking
cintiashamsu May 3, 2023
735c9c4
Added config option
cintiashamsu May 5, 2023
cff396a
added config option to multipartUploader and multipartCopy
cintiashamsu May 10, 2023
02b99aa
copied upload classes
cintiashamsu May 17, 2023
eaccd60
ObjectDownloader + download() in S3 client trait
cintiashamsu May 19, 2023
3c98ca6
notes included
cintiashamsu May 24, 2023
b71fc6c
works with parts (includes notes/incorrectly named methods)
cintiashamsu Jun 5, 2023
d5fe32b
starting to use multipartDownloadType config option (comments/misname…
cintiashamsu Jun 5, 2023
87bc27d
starting parts/ranges
cintiashamsu Jun 10, 2023
88e4603
all config options work (needs refactoring)
cintiashamsu Jun 13, 2023
3169e59
refactored handleresult & writedeststream
cintiashamsu Jun 13, 2023
a46b3be
beginning tests
cintiashamsu Jun 19, 2023
8d00990
Refactoring downloader, unfinished tests
cintiashamsu Jun 20, 2023
13eff47
downloader + checksum + tests unfinished
cintiashamsu Jul 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions src/Exception/MultipartDownloadException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
namespace Aws\Exception;

use Aws\HasMonitoringEventsTrait;
use Aws\MonitoringEventsInterface;
use Aws\Multipart\DownloadState;

class MultipartDownloadException extends \RuntimeException implements
MonitoringEventsInterface
{
use HasMonitoringEventsTrait;

/** @var DownloadState State of the erroneous transfer */
private $state;

/**
* @param DownloadState $state Upload state at time of the exception.
* @param \Exception|array $prev Exception being thrown.
*/
public function __construct(DownloadState $state, $prev = null) {
$msg = 'An exception occurred while performing a multipart download';

if (is_array($prev)) {
$msg = strtr($msg, ['performing' => 'downloading parts to']);
$msg .= ". The following parts had errors:\n";
/** @var $error AwsException */
foreach ($prev as $part => $error) {
$msg .= "- Part {$part}: " . $error->getMessage(). "\n";
}
} elseif ($prev instanceof AwsException) {
switch ($prev->getCommand()->getName()) {
case 'GetObject':
case 'GetObject':
$action = 'initiating';
break;
case 'GetObject':
$action = 'completing';
break;
}
if (isset($action)) {
$msg = strtr($msg, ['performing' => $action]);
}
$msg .= ": {$prev->getMessage()}";
}

if (!$prev instanceof \Exception) {
$prev = null;
}

parent::__construct($msg, 0, $prev);
$this->state = $state;
}

/**
* Get the state of the transfer
*
* @return DownloadState
*/
public function getState()
{
return $this->state;
}
}

Loading