noesya/osuny

View on GitHub
app/views/application/_bugsnag.html.erb

Summary

Maintainability
Test Coverage
<% unless Rails.env.development? %>
  <script src="//d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"></script>
  <script type="text/javascript" nonce="<%= request.content_security_policy_nonce %>">
    Bugsnag.start({
      apiKey: "<%= j ENV['BUGSNAG_JAVASCRIPT_KEY'] %>",
      releaseStage: "<%= j ENV['APPLICATION_ENV'] %>"
    });
    Bugsnag.addOnError(function (event) {
      if (event.originalError === 'ResizeObserver loop limit exceeded') {
        return false;
      }
    });
    <% if user_signed_in? %>
    Bugsnag.setUser("<%= j current_user.id %>", "<%= j current_user.email %>", "<%= j current_user.to_s %>");
    <% end %>
  </script>
<% end %>