Log unexpected exceptions raised by API calls.

This commit is contained in:
Tom Hughes 2009-08-15 11:35:43 +00:00
parent 9617ca2acc
commit cd8bb0dc57

View file

@ -132,6 +132,8 @@ class ApplicationController < ActionController::Base
rescue OSM::APIError => ex
report_error ex.message, ex.status
rescue Exception => ex
logger.info("API threw unexpected #{ex.class} exception: #{ex.message}")
ex.backtrace.each { |l| logger.info(l) }
report_error "#{ex.class}: #{ex.message}", :internal_server_error
end
end