[cgiapp] Debugging while using CAP::Dispatch...

Ron Savage ron at savage.net.au
Fri Apr 20 19:24:10 EDT 2012


Hi Brett

On 20/04/12 23:23, B. Estrade wrote:
> On Fri, Apr 20, 2012 at 08:57:53AM +1000, Ron Savage wrote:
>> Hi Brett
>>
>> On 20/04/12 08:47, B. Estrade wrote:
>>> I am having some time trying to figure out errors with this kind of
>>> output:
>>>
>>> 	Can't locate object method "error" via package "Can't locate
>>> 	object method "error has occured" via package...
>>>
>>> What is the best way to get useful information to the browswer when
>>> something goes awry?
>>
>> Those msgs mean there is a mis-match between the calling code and the
>> parameter list of the method you're calling (or think you're calling).
>
> Hmm...it seems that it's a side effect of CAP::Dispatch - is there a
> way to get the precise error?

The way I would do it is use CGI::Snapp::Dispatch, with a logger whose 
maxlevel was set to 'debug'.

That will log the entry to every sub (in my code only by default of 
course), so you'll know exactly which sub was entered and which one wasn't.

I'm not being sarcastic recommending CGI::Snapp-based stuff. I'm just 
telling you how I debug identical problems, which I confess having had...

-- 
Ron Savage
http://savage.net.au/
Ph: 0421 920 622


More information about the cgiapp mailing list