Commit 4a19490e by Seldaek

+ API: Added Dwoo_Compilation_Exception methods getCompiler() and getTemplate()…

+ API: Added Dwoo_Compilation_Exception methods getCompiler() and getTemplate() so you can catch the exception and use those to build a nicer error view with all the details you want git-svn-id: svn://dwoo.org/dwoo/trunk@157 0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent 668df7e5
[2008-0-] 0.9.4 / 1.0.0 ?
+ API: Added Dwoo_Compilation_Exception methods getCompiler() and
getTemplate() so you can catch the exception and use those to build a nicer
error view with all the details you want
* Fixed compiler bug that created a parse error when you had comments in an
extended template
* Fixed extends bug when extending files in other directories using relative
......
......@@ -21,9 +21,23 @@
*/
class Dwoo_Compilation_Exception extends Dwoo_Exception
{
protected $compiler;
protected $template;
public function __construct(Dwoo_Compiler $compiler, $message)
{
$tpl = $compiler->getDwoo()->getTemplate();
parent::__construct('Compilation error at line '.$compiler->getLine().' in "'.$tpl->getResourceName().':'.$tpl->getResourceIdentifier().'" : '.$message);
$this->compiler = $compiler;
$this->template = $compiler->getDwoo()->getTemplate();
parent::__construct('Compilation error at line '.$compiler->getLine().' in "'.$this->template->getResourceName().':'.$this->template->getResourceIdentifier().'" : '.$message);
}
public function getCompiler()
{
return $this->compiler;
}
public function getTemplate()
{
return $this->template;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment