I had tried using params[:exception] in the internal_server_error
method but it just returns
Merb::ControllerExceptions::InternalServerError.
On Feb 7, 2008 5:11 PM, Chris Farmiloe <chris at oxdi.eu>
wrote:>
> without looking into it too much..... I guess you could either
>
> use a filter to wrap all actions, rescue and re-raise the required
> exceptions as custom controller-exceptions.
>
> or
>
> use the internal_server_error exception action in your exceptions
> controller, inspect the exception in params[:exception] and redirect it to
a
> more suitable action.
>
>
>
> I''ve been thinking about making the exception catching more
generic in one
> of my apps, I''ll post back if I find it was a good move.
>
>
>
> On 07/02/2008, Michael Irwin <mike at manicdev.com> wrote:
> >
> >
> >
> > BTW, I''m looking for something like Rails''
rescue_from method.
> >
> >
> > On Feb 7, 2008 4:50 PM, Michael Irwin <mike at manicdev.com>
wrote:
> > > Is there an agreed upon method for handling exceptions thrown by
> > > something outside of Merb? For example, DataMapper now throws a
> > > DataMapper::ObjectNotFoundError when a record isn''t
found in the db.
> > > I''d like to catch these exceptions and raise a
C:E:NotFound exception
> > > instead, but without having to wrap a lot of code in
begin/rescue/end
> > > blocks.
> > >
> > > Thanks,
> > >
> > > Mike Irwin
> > >
> > _______________________________________________
> > Merb-devel mailing list
> > Merb-devel at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/merb-devel
> >
>
>
>
> --
>
>
>
>
> Chris Farmiloe
>
>
> web: www.oxdi.eu
> direct: 01273 782909
> skype: chrisfarms