# Handle active record erros

**URL:** <https://www.ruby-forum.com/t/handle-active-record-erros/112936>\
**Category:** Rails\
**Created:** [August 24, 2007, 5:58pm UTC](https://www.ruby-forum.com/t/handle-active-record-erros/112936 "2007-08-24T17:58:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![claxo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/b9e5f3/32.png) [@claxo](https://www.ruby-forum.com/u/claxo)\
**Post date:** [August 24, 2007, 5:58pm UTC](https://www.ruby-forum.com/t/handle-active-record-erros/112936/1 "2007-08-24T17:58:36Z")

</div>

class Product \< ActiveRecord::Base  
def self.find(\*args)  
begin  
super args  
rescue ActiveRecord::StatementInvalid =\> error  
raise “Sorry!”  
end  
end

With this i can display in the exception page whatever i want…but  
my problem is that i just want the message “Sorry!” in my template  
without using rails exception page.

Thanks

Claudio
