PHP Classes

File: application/modules/extensions/aws/Aws/Exception/CouldNotCreateChecksumException.php

Recommend this page to a friend!
  Classes of Tran Tuan   Pretty PHP S3 Files Manager   application/modules/extensions/aws/Aws/Exception/CouldNotCreateChecksumException.php   Download  
File: application/modules/extensions/aws/Aws/Exception/CouldNotCreateChecksumException.php
Role: Application script
Content type: text/plain
Description: Application script
Class: Pretty PHP S3 Files Manager
Web based interface to manage files in Amazon S3
Author: By
Last change:
Date: 8 years ago
Size: 929 bytes
 

Contents

Class file image Download
<?php
namespace Aws\Exception;

class
CouldNotCreateChecksumException extends \RuntimeException
{
    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);
    }
}