Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rails plugin emailing information about errors happened in javascript scenarios.

branch: gemify

This branch is 3 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.rdoc

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(my-super-mail@gmail.com my-second-mail@gmail.com)
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, Nick Recobra

Something went wrong with that request. Please try again.