Christopher H. Laco wrote:
I've stumbled across a problem last night that has me quite curious. I was n the middle of writing a raw Taglib and made an error along
the way.

I had decided that when something I know shouldn't happen happens (a
 root tag being nested when it shouldn't be), I would throw and
Exception from my Exceptions module (using Error).

Now, from the looks of the logs, it looks like when an exception was
 thrown, AxKit went ahead and reparsed the docusment again. I'd
assume this has something to do with AxErrorStylesheet (mine isn't
set at all).

This threw me for a loop as my module got confused since it keeps
local state between parse_start, parse_end calls using a my lexical.

So, I guess my question is somewhat easy: is this expected behaviour,
 and should my Taglib exceptions always make sure it's -text contains
an XML string in the format used in the example here:

http://cpan.uwinnipeg.ca/htdocs/AxKit/AxKit.html#axerrorstylesheet

Can I assume that based on the first sentence that this behaviour
does NOT happen if I simply die instead of throw?

Thanks, -=Chris


Here's an example of what I'm talking about....notice towards the
end...I throw and exception in a parse_start, and I get "XSP: Parser returned doc" two times, and the parse-start/end logging shows that taglib , and I'd assume the is being parsed twice...

Normally that's no big deal, but in a tablig that alters database records, that could lead to strange things happening...

Is there a way to tell within a taglib/pnotes if the request isn't the first?


[AxKit] [req] File Provider given $r: 
c:/development/cpan/handel/t/htdocs/cart_cart.xsp
[AxKit] checking if we process this resource
[AxKit] media: screen, preferred style: #default
[AxKit] Cache: key = 4fdda659947c0ba65533a9f0c0139271
[AxKit] getting styles and external entities from the XML
[AxKit] styles not cached - calling $provider->get_styles()
[AxKit] get_styles: creating XML::Parser
[AxKit] encoding to UTF-8
[AxKit] get_styles: calling 
XML::Parser->parse('c:/development/cpan/handel/t/htdocs/cart_cart.xsp')
[AxKit] get_styles: parse returned successfully
[AxKit] Calling GetMatchingProcessors with (screen, , , , 
{http://apache.org/xsp/core/v1}page)
[AxKit] get_styles: loading style modules
[AxKit] get_styles: looking for mapping for style type: 'application/x-xsp'
[AxKit] cache doesn't exist
[AxKit] some condition failed. recreating output
[AxKit] styles: Apache::AxKit::Language::XSP(.)
[AxKit] Style Provider Override: Apache::AxKit::Provider::File
[AxKit] [uri] File Provider looking up uri .
[AxKit] [uri] File Provider set filename to c:/development/cpan/handel/t/htdocs
[AxKit] about to execute: Apache::AxKit::Language::XSP::handler
[AxKit] Cache: key = 9e5cde26e9cddb373bc33b933178b335
[AxKit] XSP: parsing fh
[AxKit] XSP: Parser returned doc
[AxKit] [Handel] parse_start [cart] context: root
[AxKit] [Handel] parse_start [results] context: root
[AxKit] XSP: Parser returned doc
[AxKit] [Handel] parse_start [cart] context: root
[AxKit] [Handel] parse_start [results] context: root
[AxKit] Caught an exception
[AxKit] [Error] Parse of 'c:/development/cpan/handel/t/htdocs/cart_cart.xsp' 
failed: Tag 'results' not valid here
[AxKit] From: c:/Development/Perl/584/site/lib/Error.pm : 148
[AxKit] [Backtrace] Parse of 
'c:/development/cpan/handel/t/htdocs/cart_cart.xsp' failed: Tag 'results' not 
valid here at c:/Development/Perl/584/site/lib/Error.pm line 
148\n\tError::throw('Apache::AxKit::Exception::Error', '-text', 'Parse of 
\\'c:/development/cpan/handel/t/htdocs/cart_cart.xsp\\...') called at 
c:/Development/Perl/584/site/lib/Apache/AxKit/Language/XSP.pm line 
108\n\tApache::AxKit::Language::XSP::handler('Apache::AxKit::Language::XSP', 
'AxKit::Apache=SCALAR(0xfcfba0)', 
'Apache::AxKit::Provider::File=HASH(0x3b05800)', 
'Apache::AxKit::Provider::File=HASH(0xfcebd4)', 1) called at 
c:/Development/Perl/584/site/lib/AxKit.pm line 
759\n\tAxKit::process_request('AxKit::Apache=SCALAR(0xfcfba0)', 
'Apache::AxKit::Provider::File=HASH(0x3b05800)', 'ARRAY(0xfcced0)', 'undef') 
called at c:/Development/Perl/584/site/lib/AxKit.pm line 
474\n\tAxKit::run_axkit_engine('AxKit::Apache=SCALAR(0xfcfba0)', 
'Apache::AxKit::Provider::File=HASH(0x3b05800)') called at c:/Development/Per
l/584/site/lib/AxKit.pm line 300\n\teval {...} called at c:/Development/Perl/584/site/lib/AxKit.pm line 291\n\tAxKit::main_handler('AxKit::Apache=SCALAR(0xfcfba0)', 'Apache::AxKit::Provider::File=HASH(0x3b05800)') called at c:/Development/Perl/584/site/lib/AxKit.pm line 204\n\tAxKit::fast_handler('AxKit::Apache=SCALAR(0xfcfba0)') called at nul line 0\n\teval {...} called at nul line 0\n

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



Reply via email to