Skip Menu |

This queue is for tickets about the CGI-Application CPAN distribution.

Report information
The Basics
Id: 75205
Status: open
Priority: 0/
Queue: CGI-Application

People
Owner: Nobody in particular
Requestors: RSAVAGE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 4.50
Fixed in: (no value)



Subject: Error mode method call not protected by eval
Hi Folks In Application.pm V 4.50 line line 149 I think the call: $body = $self->$em( $error ); should be protected by an eval, or even better, Try::Tiny.
On Tue Feb 21 23:08:07 2012, RSAVAGE wrote: Show quoted text
> Hi Folks > > In Application.pm V 4.50 line line 149 I think the call: > > $body = $self->$em( $error );
When the main run mode dies, we call the error mode. If we trapped the death of the error mode, what would do then? I don't think we want to call error_mode() recursively, and don't want an error_error_mode(). Perhaps we should emulate Apache's behavior here, returning a page with text like this: "500. There was an internal server error when loading this page. Further, there was a problem loading error page." Show quoted text
> should be protected by an eval, or even better, Try::Tiny.
Phasing in Try::Tiny is a good idea. I think this the error mode idea merits some on-list discussion to create a specific proposal to address it.
Subject: Re: [rt.cpan.org #75205] Error mode method call not protected by eval
Date: Tue, 28 Feb 2012 08:34:14 +1100
To: bug-CGI-Application [...] rt.cpan.org
From: Ron Savage <ron [...] savage.net.au>
Hi Mark On 28/02/12 01:21, MARKSTOS via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=75205> > > On Tue Feb 21 23:08:07 2012, RSAVAGE wrote:
>> Hi Folks >> >> In Application.pm V 4.50 line line 149 I think the call: >> >> $body = $self->$em( $error ); >> should be protected by an eval, or even better, Try::Tiny.
> > When the main run mode dies, we call the error mode. If we trapped the > death of the error mode, what would do then?
I think by using Try::Tiny the code can gracefully output a specific error msg [1] and then die. [1] Including run mode, method name, autoload status. Show quoted text
> I don't think we want to call error_mode() recursively, and don't want > an error_error_mode().
No, we don't want recursion. Show quoted text
> Perhaps we should emulate Apache's behavior here, returning a page with > text like this: "500. There was an internal server error when loading > this page. Further, there was a problem loading error page."
Too vague if you ask me. Show quoted text
> Phasing in Try::Tiny is a good idea. > > I think this the error mode idea merits some on-list discussion to > create a specific proposal to address it.
Yes. I suggest you forward this email to the list to get started, since it should have enough info in it to orient the reader. -- Ron Savage http://savage.net.au/ Ph: 0421 920 622