lib/templates/javascript_notifier.erb in airbrake-3.1.10 vs lib/templates/javascript_notifier.erb in airbrake-3.1.11

- old
+ new

@@ -4,12 +4,17 @@ document.write(unescape("%3Cscript src='" + notifierJsScheme + "#{host}/javascripts/notifier.js' type='text/javascript'%3E%3C/script%3E")); })(); }%> <%= javascript_tag %Q{ + try { window.Airbrake = (typeof(Airbrake) == 'undefined' && typeof(Hoptoad) != 'undefined') ? Hoptoad : Airbrake Airbrake.setKey('#{api_key}'); Airbrake.setHost('#{host}'); Airbrake.setEnvironment('#{environment}'); Airbrake.setErrorDefaults({ url: "#{escape_javascript url}", component: "#{controller_name}", action: "#{action_name}" }); + } + catch (e) { + window.onerror = null; + } } %>