def rescue_action_in_public(exception)
case exception
when *self.class.exceptions_to_treat_as_404
render_404
else
log_exception(exception)
render :text => "#{exception.class}" and return
end
end
def log_exception(exception)
LoggedException.create(
:action_name => self.action_name,
:controller_name => self.controller_name,
:exception_class => exception.class.to_s,
:message => exception.clean_message,
:request => request.parameters.inspect,
:session => request.session.instance_variable_get("@data")
)
end
Rails记录异常
最新推荐文章于 2023-06-06 17:38:22 发布