-
Notifications
You must be signed in to change notification settings - Fork 289
Closed
Description
Context:
We use statically generated error pages in rails to render custom errors. We use Rollbar to report custom errors on those pages (504 timeouts are the most useful error we log with this setup as we only have to generate the error page once, and serve the static version thereafter).
Problem:
The rollbar middleware only injects the snippet on pages with a 200 html response, which means we have to copy/paste the snippet (and all subsequent gem updates).
Suspect code in this file (line 9 contains a comment stating this is expected behavior and line 43 contains the suspect code).
.../ruby-2.2.2/gems/rollbar-2.15.5/lib/rollbar/middleware/js.rb
def add_js?(env, status, headers)
enabled? && status == 200 && !env[JS_IS_INJECTED_KEY] &&
html?(headers) && !attachment?(headers) && !streaming?(env)
end
Any ideas for a workaround? Is there a stable way to render the snippet manually in specific layouts?