# Rescue runtime error

**URL:** <https://www.ruby-forum.com/t/rescue-runtime-error/162122>\
**Category:** Rails\
**Created:** [March 5, 2009, 11:36pm UTC](https://www.ruby-forum.com/t/rescue-runtime-error/162122 "2009-03-05T23:36:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajasekaramya](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f17d59/32.png) [@Rajasekaramya](https://www.ruby-forum.com/u/Rajasekaramya)\
**Post date:** [March 5, 2009, 11:36pm UTC](https://www.ruby-forum.com/t/rescue-runtime-error/162122/1 "2009-03-05T23:36:11Z")

</div>

hi

I am trying to rescue the runtime error and trying to access the  
exception  
object but it returns [#,#,#,#] i dont know why

here is my code for rescuing the runtime error in application.rb.

rescue\_from Exception , :with =\> :runtime\_error

def runtime\_error(exception) render :text =\>  
exception.message.to\_s,:layout=\> â€˜bug.rhtmlâ€™, :status =\> not\_found

it rescues the run time error page but doesnt print the error messages.

Let me know any suggestions

Regards  
Ramya  
end

–  
View this message in context:  
[http://www.nabble.com/rescue-runtime-error-tp22362268p22362268.html](http://www.nabble.com/rescue-runtime-error-tp22362268p22362268.html)  
Sent from the RubyOnRails Users mailing list archive at [Nabble.com](http://Nabble.com).
