Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Link error to current appsignal transaction if available

Christophe Bliard7d28db8e3959
diff --git a/lib_static/open_project/appsignal.rb b/lib_static/open_project/appsignal.rb
index bf4b1b86d3d..5e08cf028ef 100644
--- a/lib_static/open_project/appsignal.rb
+++ b/lib_static/open_project/appsignal.rb
@@ -36,8 +36,14 @@ module OpenProject
def exception_handler(message, log_context = {})
if (exception = log_context[:exception])
- ::Appsignal.send_error(exception) do |transaction|
- transaction.set_tags tags(log_context)
+ if Appsignal::Transaction.current?
+ ::Appsignal.set_error(exception) do |transaction|
+ transaction.set_tags tags(log_context)
+ end
+ else
+ ::Appsignal.send_error(exception) do |transaction|
+ transaction.set_tags tags(log_context)
+ end
end
else
Rails.logger.warn "Ignoring non-exception message for appsignal #{message.inspect}"