Overriding 500 (was Re: Where are the balloons ?)

Lionel Orry lionel.orry at gmail.com
Tue Jul 18 04:29:57 EDT 2006


Indeed I am not into dark things, let's keep it simple and clear. That's the philosophy after all, isn't it ?

regards

why the lucky stiff wrote:
> On Mon, Jul 17, 2006 at 05:05:10PM +0200, Lionel Orry wrote:
>> BTW, Camping would be nice to develop a small 'rescue server' (on an error of the main server, redirection to an context-analysis-capable app... could be an idea).
> 
> You can override the ServerError class to show something else if you're not into
> Camping Problem!
> 
>   modules Balloon::Controllers
>     class ServerError
>       def get(klass, meth, err)
>         @status = 500
>         render :no_camping_problem
>       end
>     end
>   end
> 
>   module Balloon::Views
>     def no_camping_problem
>       div { ... }
>     end
>   end
> 
> The nice thing about this approach is that is picks up your layout.  The bad
> thing about this is that if your ServerError override throws an error, things
> will really go dark.
> 
> _why
> _______________________________________________
> Camping-list mailing list
> Camping-list at rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
> 



More information about the Camping-list mailing list