CouldNotCreateChecksumException.php 929 B

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