From 9a9c04512e5dcb77c7fe5d850e3f2a0250cc160e Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 18 Jan 2017 20:07:16 +0100 Subject: * Motor Sport Magazine feed provider --- lib/querypath/src/QueryPath/ParseException.php | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 lib/querypath/src/QueryPath/ParseException.php (limited to 'lib/querypath/src/QueryPath/ParseException.php') diff --git a/lib/querypath/src/QueryPath/ParseException.php b/lib/querypath/src/QueryPath/ParseException.php new file mode 100644 index 0000000..7da7beb --- /dev/null +++ b/lib/querypath/src/QueryPath/ParseException.php @@ -0,0 +1,44 @@ +level == LIBXML_ERR_WARNING ? self::WARN_MSG_FORMAT : self::ERR_MSG_FORMAT; + $msgs[] = sprintf($format, $err->file, $err->line, $err->column, $err->message, $err->code); + } + $msg .= implode("\n", $msgs); + + if (isset($file)) { + $msg .= ' (' . $file; + if (isset($line)) $msg .= ': ' . $line; + $msg .= ')'; + } + + parent::__construct($msg, $code); + } + + public static function initializeFromError($code, $str, $file, $line, $cxt) { + //printf("\n\nCODE: %s %s\n\n", $code, $str); + $class = __CLASS__; + throw new $class($str, $code, $file, $line); + } +} -- cgit v1.2.3