ParserException.php 703 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /*
  3. * This file is part of the PHPASN1 library.
  4. *
  5. * Copyright © Friedrich Große <friedrich.grosse@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace FG\ASN1\Exception;
  11. class ParserException extends \Exception
  12. {
  13. private $errorMessage;
  14. private $offset;
  15. public function __construct($errorMessage, $offset)
  16. {
  17. $this->errorMessage = $errorMessage;
  18. $this->offset = $offset;
  19. parent::__construct("ASN.1 Parser Exception at offset {$this->offset}: {$this->errorMessage}");
  20. }
  21. public function getOffset()
  22. {
  23. return $this->offset;
  24. }
  25. }