Skip to content

Commit

Permalink
provide metadata to sentry. datacite/datacite#703
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Mar 23, 2019
1 parent 7c2913e commit 9c259d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
11 changes: 5 additions & 6 deletions app/controllers/dois_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class DoisController < ApplicationController
prepend_before_action :authenticate_user!
before_action :set_doi, only: [:show, :destroy, :get_url]
before_action :set_include, only: [:index, :show, :create, :update]
before_action :set_raven_context, only: [:create, :update, :validate]

def index
authorize! :read, Doi
Expand Down Expand Up @@ -556,11 +557,9 @@ def safe_params
:lastLandingPageStatusResult, :lastLandingPageContentType)
end

# def add_metadata_to_bugsnag(report)
# return nil unless params.dig(:data, :attributes, :xml).present?
def set_raven_context
return nil unless params.dig(:data, :attributes, :xml).present?

# report.add_tab(:metadata, {
# metadata: Base64.decode64(params.dig(:data, :attributes, :xml))
# })
# end
Raven.extra_context metadata: Base64.decode64(params.dig(:data, :attributes, :xml))
end
end
8 changes: 0 additions & 8 deletions app/controllers/works_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,4 @@ def set_include
@include = nil
end
end

# def add_metadata_to_bugsnag(report)
# return nil unless params.dig(:data, :attributes, :xml).present?

# report.add_tab(:metadata, {
# metadata: Base64.decode64(params.dig(:data, :attributes, :xml))
# })
# end
end

0 comments on commit 9c259d8

Please sign in to comment.