Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Now throws PHPTal_TemplateException when using metal:define-macro & metal:use-macro #3

Merged
merged 1 commit into from

2 participants

@cwisefool

Now throws PHPTal_TemplateException for error thrown when simultaneously
using metal:define-macro and metal:use-macro for the same macro.
(Passes line # and file of error location so the exception will show these)

@cwisefool cwisefool Update to d1e0db4: Throw PHPTal_TemplateException w/ line # & file
Now throws PHPTal_TemplateException for error thrown when simultaneously
using metal:define-macro and metal:use-macro for the same macro.
(Passes line # and file of error location so the exception will show these)09
a35c893
@pornel
Owner

Thanks, now it's a solid fix!

@pornel pornel merged commit 0824c16 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 31, 2012
  1. @cwisefool

    Update to d1e0db4: Throw PHPTal_TemplateException w/ line # & file

    cwisefool authored
    Now throws PHPTal_TemplateException for error thrown when simultaneously
    using metal:define-macro and metal:use-macro for the same macro.
    (Passes line # and file of error location so the exception will show these)09
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  classes/PHPTAL/Php/Attribute/METAL/UseMacro.php
View
3  classes/PHPTAL/Php/Attribute/METAL/UseMacro.php
@@ -57,7 +57,8 @@ public function before(PHPTAL_Php_CodeWriter $codewriter)
if ($defineAttr = $this->phpelement->getAttributeNodeNS(
'http://xml.zope.org/namespaces/metal', 'define-macro')) {
if ($defineAttr->getValue() == $macroname)
- throw new Exception("Cannot simultaneously define and use macro '$macroname'");
+ throw new PHPTAL_TemplateException("Cannot simultaneously define and use macro '$macroname'",
+ $this->phpelement->getSourceFile(), $this->phpelement->getSourceLine());
}
// local macro (no filename specified) and non dynamic macro name
Something went wrong with that request. Please try again.