Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-16 21:14:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-16 21:14:09 +0300
commitcab5a484fe5153edc5463603923491b1487faa5f (patch)
tree70ab8059b964452839165c99a48d2223536ca769 /lib/gitlab/error_tracking.rb
parent6aaec2fc6c3e3f96f443b96fd53ae9ed5e7979af (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/error_tracking.rb')
-rw-r--r--lib/gitlab/error_tracking.rb14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/gitlab/error_tracking.rb b/lib/gitlab/error_tracking.rb
index 3a8bf95f121..6a637306225 100644
--- a/lib/gitlab/error_tracking.rb
+++ b/lib/gitlab/error_tracking.rb
@@ -140,19 +140,9 @@ module Gitlab
end
def inject_context_for_exception(event, ex)
- case ex
- when ActiveRecord::StatementInvalid
- # StatementInvalid may be caused by a statement timeout or a bad query
- event.extra[:sql] = normalize_query(ex.sql.to_s)
- else
- inject_context_for_exception(event, ex.cause) if ex.cause.present?
- end
- end
+ sql = Gitlab::ExceptionLogFormatter.find_sql(ex)
- def normalize_query(sql)
- PgQuery.normalize(sql)
- rescue PgQuery::ParseError
- sql
+ event.extra[:sql] = sql if sql
end
end
end