Forum: Ruby on Rails defining own exceptions in rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
andreim (Guest)
on 2007-07-28 19:41
(Received via mailing list)
Hi,

I would like to define my own exceptions in rails. I would like these
definitions to be available throughout my application. What's an
elegant/good way to do this? The only way I can think of doing this is
by putting all of my exception definitions in config/environment.rb,.
Is there a better/standard way of doing this?
Thanks!

--Andrei
Ryan Carmelo Briones (Guest)
on 2007-07-28 19:49
(Received via mailing list)
andreim wrote:
>
> --Andrei
>
>

I'd say create an exceptions.rb in the lib/ directory of your rails
application. The only "not nice" thing about that is that you still have
to
call require 'exceptions' from your environment.rb. You could do the
same
thing, without having to add configuration to environment.rb, by turning
it
into a plugin.

---
Ryan Carmelo Briones

--
View this message in context:
http://www.nabble.com/defining-own-exceptions-in-r...
Sent from the RubyOnRails Users mailing list archive at Nabble.com.
This topic is locked and can not be replied to.