XmlErrorException.php 479 B

1234567891011121314151617181920
  1. <?php
  2. namespace JMS\SerializerBundle\Exception;
  3. class XmlErrorException extends RuntimeException
  4. {
  5. private $xmlError;
  6. public function __construct(\LibXMLError $error)
  7. {
  8. parent::__construct(sprintf('%d: Could not parse XML: %s in %s (line: %d, column: %d)', $error->level, $error->message, $error->file, $error->line, $error->column));
  9. $this->xmlError = $error;
  10. }
  11. public function getXmlError()
  12. {
  13. return $this->xmlError;
  14. }
  15. }