lib/errational/errationality.rb in errational-0.7.1 vs lib/errational/errationality.rb in errational-0.8.16
- old
+ new
@@ -13,10 +13,20 @@
def render_error(message)
if request.xhr?
render :partial => Errational.error_partial, :status => Errational.error_response_code, :locals => {:message => message}
else
- render :text => message, :status => Errational.error_response_code
+ respond_to do |format|
+ format.text do
+ render :text => message, :status => Errational.error_response_code
+ end
+ format.html do
+ render :text => message, :status => Errational.error_response_code
+ end
+ format.json do
+ render :json => message, :status => Errational.error_response_code
+ end
+ end
end
end
def log_exception(exception)
Errational.logger.info "An exception occurred and was handled #{exception.class} : #{exception.to_s}"