Home > js_exceptions

js_exceptions

Js_exceptions is a project mainly written in JAVASCRIPT and RUBY, based on the MIT license.

Rails plugin emailing information about errors happened in javascript scenarios.

= JsExceptions

Javascript errors catching plugin. Delivers errors to email or to hoptoad. Consists of 3 files:

  • exception_notifier.js - library for catching errors
  • notifying_start.js, notifying_stop.js - used in concatenation framework (Jammit or Sprockets). Must be inserted at the top and at the bottom of file list.

== Usage and configuration

Configure JS Exceptions:

config/initializers/js_exceptions.rb

JsExceptions.configure do |c| c.handler = :email # or :hoptoad c.email_prefix = "[js error] " c.exception_recipients = %w([email protected] [email protected]) end

Insert in head of page:

<%= js_exceptions_options %>

Include JS Exceptions:

<%= javascript_include_tag "exception_notifier" %>

Or inlclude JS Exceptions in your asset packaging system:

javascripts: behaviors:

  • public/javascripts/exception_notifier.js
  • public/javascripts/notifying_start.js
  • public/javascripts/behaviors/*.js
  • public/javascripts/notifying_stop.js

In your code:

try { throw("Test exception"); } catch(e) { ExceptionNotifier.notify(e); }

== Installation

script/plugin install git://github.com/over/js_exceptions.git script/generate js_exceptions

=== Contributors {Mikhail Tabunov}[http://github.com/over], {Nick Recobra}[http://github.com/oruen]

Previous:oop.ex1