summaryrefslogtreecommitdiffstats
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-04-29 15:19:19 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-04-29 15:19:19 +0000
commit488879d9cf63c608bff61ead48b4d55de244b4a4 (patch)
tree0b9a4157e31580c0ad3b6e8d54a1e30d14794cda /app/controllers/application_controller.rb
parente65c3cfc7df3da58071c8de158c98861dab7d852 (diff)
downloadredmine-488879d9cf63c608bff61ead48b4d55de244b4a4.tar.gz
redmine-488879d9cf63c608bff61ead48b4d55de244b4a4.zip
Refactor: pull #query_statement_invalid up to ApplicationController.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3696 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 5e2ab7ed9..66886ea00 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -329,4 +329,13 @@ class ApplicationController < ActionController::Base
def render_attachment_warning_if_needed(obj)
flash[:warning] = l(:warning_attachments_not_saved, obj.unsaved_attachments.size) if obj.unsaved_attachments.present?
end
+
+ # Rescues an invalid query statement. Just in case...
+ def query_statement_invalid(exception)
+ logger.error "Query::StatementInvalid: #{exception.message}" if logger
+ session.delete(:query)
+ sort_clear if respond_to?(:sort_clear)
+ render_error "An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator."
+ end
+
end