# Writing all rails application exceptions/errors to a model

**URL:** <https://www.ruby-forum.com/t/writing-all-rails-application-exceptions-errors-to-a-model/178240>\
**Category:** Rails\
**Created:** [October 31, 2009, 4:42pm UTC](https://www.ruby-forum.com/t/writing-all-rails-application-exceptions-errors-to-a-model/178240 "2009-10-31T16:42:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cduv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3ec8ea/32.png) [@cduv](https://www.ruby-forum.com/u/cduv)\
**Post date:** [October 31, 2009, 4:42pm UTC](https://www.ruby-forum.com/t/writing-all-rails-application-exceptions-errors-to-a-model/178240/1 "2009-10-31T16:42:54Z")

</div>

Hi,

I will like to trap all application exceptions to a model. Can someone  
give me some approach to do this task?

The idea is to know in a model log what exceptions and errors my app  
is having.

Thanks in advance

Genís

---

<div class="post-metadata">

**Author:** ![cduv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3ec8ea/32.png) [@cduv](https://www.ruby-forum.com/u/cduv)\
**Post date:** [October 31, 2009, 4:59pm UTC](https://www.ruby-forum.com/t/writing-all-rails-application-exceptions-errors-to-a-model/178240/2 "2009-10-31T16:59:18Z")

</div>

I think this should do what you’re looking for:

[http://e-haitham.blogspot.com/2008/06/rails-exception-handling-has-never-been.html](http://e-haitham.blogspot.com/2008/06/rails-exception-handling-has-never-been.html)

Chris

On Sat, Oct 31, 2009 at 8:41 AM, cduv [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> GenÃ­s
> 
> >

–  
Christopher Cowan

“Making the simple complicated is commonplace; making the complicated  
simple, awesomely simple, that’s creativity”  
– Charls Mingus, Jazz Bassist

---

<div class="post-metadata">

**Author:** ![cduv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3ec8ea/32.png) [@cduv](https://www.ruby-forum.com/u/cduv)\
**Post date:** [November 1, 2009, 4:10pm UTC](https://www.ruby-forum.com/t/writing-all-rails-application-exceptions-errors-to-a-model/178240/3 "2009-11-01T16:10:48Z")

</div>

Not specifically what you’re looking for, but have you looked at  
Hoptoad? It’s a pretty handy way to track exceptions in production,  
and involves a lot less work than trying to roll up your own.

–Matt J.

On Oct 31, 10:41 am, cduv [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> I will like to trap all application exceptions to a model. Can someone  
> give me some approach to do this task?
> 
> The idea is to know in a model log what exceptions and errors my app  
> is having.
> 
> Thanks in advance
> 
> Gen
