Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: users

Newbie: throw_error & debugging

 

 

Bricolage users RSS feed   Index | Next | Previous | View Threaded


michael.fletcher at cbs

Mar 5, 2009, 10:20 AM

Post #1 of 7 (1424 views)
Permalink
Newbie: throw_error & debugging

Hello,

Some of our publish code is using $burner->throw_error to report errors
that should not be fatal, and yet that method appears to only have fatal
results. In other words, it throws the error in the jobs queue, and
then dies.

Are there alternatives to throw a non-fatal error to the job queue, or
elsewhere, and have the job continue processing. I've searched the API
and cannot find anything.

Thank you,
Mike


david at kineticode

Mar 5, 2009, 10:31 AM

Post #2 of 7 (1357 views)
Permalink
Re: Newbie: throw_error & debugging [In reply to]

On Mar 5, 2009, at 10:20 AM, Fletcher, Michael wrote:

> Hello,
>
> Some of our publish code is using $burner->throw_error to report
> errors
> that should not be fatal, and yet that method appears to only have
> fatal
> results. In other words, it throws the error in the jobs queue, and
> then dies.
>
> Are there alternatives to throw a non-fatal error to the job queue, or
> elsewhere, and have the job continue processing. I've searched the
> API
> and cannot find anything.

Only call throw_error in publish mode.

my $img = $element->get_related_media;
$burner->throw_error('You forgot an image!')
if !$img && $burner->get_mode == PUBLISH_MODE;

Best,

David


michael.fletcher at cbs

Mar 5, 2009, 1:40 PM

Post #3 of 7 (1359 views)
Permalink
RE: Newbie: throw_error & debugging [In reply to]

What if we want an error to show in publish mode, but we just don't want
it to be fatal?

Thanks,
Mike


bret at pectopah

Mar 5, 2009, 2:28 PM

Post #4 of 7 (1358 views)
Permalink
RE: Newbie: throw_error & debugging [In reply to]

Hi Mike,

You could try Bric::App::Util::add_msg('your message goes here'). Then
the non-fatal error will show alongside the success messages following
the publish.

Hope this helps,

Bret


On Thu, 2009-03-05 at 13:40 -0800, Fletcher, Michael wrote:
> What if we want an error to show in publish mode, but we just don't want
> it to be fatal?
>
> Thanks,
> Mike
>
>
--
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bret [at] pectopah
www.pectopah.com


david at kineticode

Mar 5, 2009, 2:44 PM

Post #5 of 7 (1360 views)
Permalink
Re: Newbie: throw_error & debugging [In reply to]

On Mar 5, 2009, at 1:40 PM, Fletcher, Michael wrote:

> What if we want an error to show in publish mode, but we just don't
> want
> it to be fatal?

Where do you want it to show? You probably want `warn`.

Best,

David


zdravko.balorda at siix

Mar 5, 2009, 11:19 PM

Post #6 of 7 (1352 views)
Permalink
Re: Newbie: throw_error & debugging [In reply to]

>> What if we want an error to show in publish mode, but we just don't want
>> it to be fatal?
>
> Where do you want it to show? You probably want `warn`.

That would be interesting: throw_warning(), but it would probably have
to go into a separate window.

add_msg() appears too late.

Zdravko


david at kineticode

Mar 6, 2009, 9:13 AM

Post #7 of 7 (1351 views)
Permalink
Re: Newbie: throw_error & debugging [In reply to]

On Mar 5, 2009, at 11:19 PM, Zdravko Balorda wrote:

>>> What if we want an error to show in publish mode, but we just
>>> don't want
>>> it to be fatal?
>> Where do you want it to show? You probably want `warn`.
>
> That would be interesting: throw_warning(), but it would probably
> have to go into a separate window.

Patches welcome. I can see that it'd be useful to have it go to a
window if one is available, and the error log if it's not.

Best,

David

Bricolage users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.