I have a CGI:Application running on Apache/mod_perl. Everything works, except when I get any sort of error. The application terminates with a 500 code, and I get the following message:
"Can't locate object method 'error' via package "Template::Exception" at /usr/local/lib .../CGI/Application/Dispatch.pm line 438."

In my Setup sub (where Run Modes are defined), I am setting "$app->error_mode('error')", and then I have my own sub named "error" in that module.

Is it me that is doing something wrong, or is this an internal module error that I have no control over?

Oh, and one more thing ...

In my own error sub, I am trying to use the $app object to call "tt_process" to display my error template.

Possibly I don't have access to the $app object?

In reading the docs, I see that I only get $@ passed.

Does this mean I get to write directly to the client (an otherwise no-no in CGI:Apps)?

Thanks much, Ray


In reply to CGI:Application "error" by neptuneray

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.