Scott Fleckenstein
2006-Nov-27 15:35 UTC
[ANN] Exceptional 1.0 - A new style of handling exceptions
Exceptional is a plugin for Ruby on Rails that brings exception handling into the world of RoR filters. Through two declarative statements that are similar in style to filter declarations in your controllers you get easy and powerful exception handling in your application. An example usage: ------------------------------------------------------------------------------- class RubberDuckiesController < ApplicationController handles :unhandled, :with => :unhandled_error handles AccessDeniedError, :with => :access_denied, :except => [:list, :show] raises InvalidRequest, :if => {:method => [:destroy]}, :only => [:list, :new] def create ... raise AccessDeniedError ... end private def access_denied render system_path(''access_denied'') end def unhandled_error redirect_to new_error_report_path end end ------------------------------------------------------------------------------- See the README for full info on all of the features: http://hg.nullstyle.com/exceptional/file/tip/README Please note that this is only compatible with rails 1.2RC and newer, and the tests are written using RSpec. To Install: script/plugin install http://hg.nullstyle.com/raw/exceptional For More Info: http://nullstyle.com/home/exceptional To Browse The Source: http://hg.nullstyle.com/exceptional Agile Web Development Plugin Page: http://www.agilewebdevelopment.com/plugins/exceptional Thanks for your time, Scott Fleckenstein --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ezra Zygmuntowicz
2006-Nov-27 22:37 UTC
Re: [ANN] Exceptional 1.0 - A new style of handling exceptions
On Nov 27, 2006, at 7:35 AM, Scott Fleckenstein wrote:> > Exceptional is a plugin for Ruby on Rails that brings exception > handling into > the world of RoR filters. Through two declarative statements that are > similar in > style to filter declarations in your controllers you get easy and > powerful > exception handling in your application. > <snip> > > Thanks for your time, > Scott FleckensteinLooks pretty cool Scott, I like it. Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez-NLltGlunAUd/unjJdyJNww@public.gmane.org -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Paolo Negri
2006-Nov-27 22:49 UTC
Re: [ANN] Exceptional 1.0 - A new style of handling exceptions
Yes, it''s brilliant, could you explain why it works just with 1.2RC Thanks Paolo On 27/11/06, Scott Fleckenstein <nullstyle-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Exceptional is a plugin for Ruby on Rails that brings exception > handling into > the world of RoR filters. Through two declarative statements that are > similar in > style to filter declarations in your controllers you get easy and > powerful > exception handling in your application.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Scott Fleckenstein
2006-Nov-28 04:49 UTC
Re: [ANN] Exceptional 1.0 - A new style of handling exceptions
It only works in rails 1.2 RC because I use alias_method_chain as well as add "RAILS_ROOT/app/errors" to the Dependency.load_paths so that you get nice autoloading and such for custom errors. I suppose I could work around those in an update that extends compatability to 1.1.6 -Scott On Nov 27, 2:49 pm, "Paolo Negri" <hungryl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Yes, it''s brilliant, could you explain why it works just with 1.2RC > > Thanks > > Paolo > > On 27/11/06, Scott Fleckenstein <nullst...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Exceptional is a plugin for Ruby on Rails that brings exception > > handling into > > the world of RoR filters. Through two declarative statements that are > > similar in > > style to filter declarations in your controllers you get easy and > > powerful > > exception handling in your application.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Scott Fleckenstein
2006-Nov-29 07:14 UTC
Re: Exceptional 1.0 - A new style of handling exceptions
An Update: I''ve extended Exceptional to support 1.1.6, with a few addenda. First, I cannot reliably distinguish between versions of rails if you have frozen rails in your application. I can''t use Rails version defined in version.rb because it is the same between 1.2RC and 1.1.6, and so I have to rely on rubygems to decide whether I should include the compatability patches. Speaking of them, the are all simply included in a file called compatability_116.rb for easy removal. I would desire to remove these patches as 1.2 goes final for the simple fact that to get the handles directive to catch routing errors, I have to redefine Dispatcher.dispatch to use the version in the RC. Doing so makes me feel really icky. Anyways, patches are welcome to add support for frozen installations of 1.1.6. Thanks, Scott --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---