around_action :better_errors_allow_inline, :if => proc { Rails.env.development? }
attr_accessor :current_user
+
helper_method :current_user
+ helper_method :preferred_langauges
private
def api_call_handle_error
yield
+ rescue ActionController::UnknownFormat
+ head :not_acceptable
rescue ActiveRecord::RecordNotFound => e
head :not_found
rescue LibXML::XML::Error, ArgumentError => e
e = e.cause
if e.is_a?(Timeout::Error) ||
- (e.is_a?(ActiveRecord::StatementInvalid) && e.message =~ /execution expired/)
+ (e.is_a?(ActiveRecord::StatementInvalid) && e.message.include?("execution expired"))
render :action => "timeout"
else
raise