Rescue invalid query statement error with an error message.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3104 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-11-28 10:29:48 +00:00
parent 915bbcfaff
commit 99b52c8796
3 changed files with 30 additions and 0 deletions
+10
View File
@@ -26,6 +26,8 @@ class IssuesController < ApplicationController
before_filter :find_optional_project, :only => [:index, :changes, :gantt, :calendar]
accept_key_auth :index, :show, :changes
rescue_from Query::StatementInvalid, :with => :query_statement_invalid
helper :journals
helper :projects
include ProjectsHelper
@@ -507,4 +509,12 @@ private
end
end
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
render_error "An error occurred while executing the query and has been logged. Please report this error to your Redmine administrator."
end
end