Spaces-API/aws/Aws/Exception/CouldNotCreateChecksumException.php
Devang Srivastava e6d7753dc8 v2: Updates
* Simplifies & beautifies everything
* Introduces a new Class system.
* Errors are defaulted to AWS's handler.
* New function names & more efficient handling.
* Should fix a majority of the errors.

Please read the README for more!
2020-09-28 15:32:51 +05:30

25 lines
1 KiB
PHP

<?php
namespace Aws\Exception;
use Aws\HasMonitoringEventsTrait;
use Aws\MonitoringEventsInterface;
class CouldNotCreateChecksumException extends \RuntimeException implements
MonitoringEventsInterface
{
use HasMonitoringEventsTrait;
public function __construct($algorithm, \Exception $previous = null)
{
$prefix = $algorithm === 'md5' ? "An" : "A";
parent::__construct("{$prefix} {$algorithm} checksum could not be "
. "calculated for the provided upload body, because it was not "
. "seekable. To prevent this error you can either 1) include the "
. "ContentMD5 or ContentSHA256 parameters with your request, 2) "
. "use a seekable stream for the body, or 3) wrap the non-seekable "
. "stream in a GuzzleHttp\\Psr7\\CachingStream object. You "
. "should be careful though and remember that the CachingStream "
. "utilizes PHP temp streams. This means that the stream will be "
. "temporarily stored on the local disk.", 0, $previous);
}
}