StandardError, rather, not StandardException.
On Mar 6, 4:52 pm, Taylor Hughes <tehug...@wisc.edu>
wrote:> Hi,
>
> I''m writing some scripts on the command line using ActiveRecord,
and
> some interesting (read: confusing) things are happening with the way
> exceptions are caught and re-raised.
>
> In AbstractAdapter.log (connection_adapters/abstract_adapter.rb:144),
> Exception is rescued and reraised as an ActiveRecord::StatementInvalid
> exception. While in most cases I''m sure this is fine, Exception
> includes things like SystemExit and SignalException, which have
> nothing to do with invalid SQL. If I''m executing a statement when
I
> send a TERM signal to the process (or call exit(0) when I trap it), if
> I catch StatementInvalid and deal with it somehow my script is going
> to continue running.
>
> I just noticed in r8484 the other thing I was going to mention
(''TERM''
> being trapped in transactions.rb) was fixed; that produced similar
> behavior.
>
> Even changing Exception to StandardException inside
> AbstractAdapter.log would solve most of what I''m seeing. Does
anyone
> have any thoughts on this?
>
> Thanks,
>
> Taylor
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---