Error

The break button calls a function that contains an error. The error is wrapped in a try...catch block, which calls the Error function to prompt the user and send an error notification.

Next Steps

  1. Sign up to receive an Application Key for your email address.
  2. Click the link in the confirmation email.
  3. Follow the setup instructions.

Download the demo

What to expect

  1. A box appears prompting you to describe your most recent actions:
  2. One of the following occurs:
    • you type something and click send
    • you click "close"
    • 10 seconds pass with you doing nothing
  3. DamnIT emails the developer the following information:
    • Browser
    • Page
    • HTML Content
    • Description (if you entered one)
    • Error message
    • File name, line number, and stack (if the browser supports them)

How it works

When the giant button above is clicked, it calls breakme. Here is the HTML:

<a href='#' onclick='breakme()'><div class='break'></div></a>
Error button HTML

Breakme is a function containing an error. We catch the error and invoke Error's notification functionality using a call to ApplicationError.notify:

// the onclick event handler for the link we clicked
var breakme = function(){ 
    // surrounding your event handler code with try...catch ensures DamnIT 
    // notifies you of errors in all browsers
    try { 
        // this function doesn't exist, so it will cause an error
        a.func.that.will.brea.k(); 
    } catch(e) { // the catch code runs when an error occurs in the try code
        ApplicationError.notify(e); // invokes DamnIT's functionality
    }
}
onclick event handler with an error

Related Learning

API
Low level documentation on the error methods.

Overview
What is Error, how does it work, and why should you use it.

Demo
See it in action. Then download the demo code and start using it yourself.