# Truncated development log when using rescue\_from

**URL:** <https://www.ruby-forum.com/t/truncated-development-log-when-using-rescue-from/164690>\
**Category:** Rails\
**Created:** [April 4, 2009, 1:52am UTC](https://www.ruby-forum.com/t/truncated-development-log-when-using-rescue-from/164690 "2009-04-04T01:52:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve\_at\_trend](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/258eb7/32.png) [@steve\_at\_trend](https://www.ruby-forum.com/u/steve_at_trend)\
**Post date:** [April 4, 2009, 1:52am UTC](https://www.ruby-forum.com/t/truncated-development-log-when-using-rescue-from/164690/1 "2009-04-04T01:52:55Z")

</div>

I’m noticing that my development.log messages are not showing the usual  
complete logging per request/response when I am catching exceptions from  
my controllers using rescue\_from. I was wondering if anyone has ever  
encountered this issue before. I’m using Rails 2.2.2.

Processing DomainsController#show to xml (for 127.0.0.1 at 2009-04-03  
16:41:38) [GET]  
Parameters: {“format”=\>“xml”, “action”=\>“show”, “id”=\>“test6”,  
“controller”=\>“domains”}  
SQL (0.1ms) SET SQL\_AUTO\_IS\_NULL=0  
Account Columns (3.6ms) SHOW FIELDS FROM `accounts`  
Domain Columns (1.8ms) SHOW FIELDS FROM `domains`  
Domain Load (0.8ms) SELECT \* FROM `domains` WHERE  
(`domains`.`domainname` = ‘test6’) LIMIT 1

I would expect to see a final confirmation of the HTTP status code, but  
instead I see the above without it, but the correct 404 status code is  
returned back to my client program.  
Completed in 81ms (View: 0, DB: 2) | 404 Not Found  
[[http://localhost/services/domains/test6](http://localhost/services/domains/test6)]

My rescue\_from implementation:

class ApplicationController \< ActionController::Base  
rescue\_from InvalidDomainError, :with =\> :handle404NotFound  
…

def handle404NotFound(e)  
render :xml =\> generateErrorXML(e.to\_s), :status =\> 404  
end

def generateErrorXML(error\_str)  
“\<?xml version=\"1.0\" encoding=\"UTF-8\"?\>  
  
#{request.method}  
#{request.request\_uri}  
#{error\_str}  
”  
end

Thanks in advance,  
Steve
