GithubHelp home page GithubHelp logo

appfail-javascript's Introduction

Appfail JavaScript Reporting Module

Development note: appfail-reporting.js must pass JSHint Linting in order for it to be valid.

Installation

To begin reporting Javascript failures to appfail, add the following script tag into your page:

<script type="text/javascript" src="https://s3.amazonaws.com/appfail-us/appfail.reporting.min.js?slug=abc123"></script>

Testing

OK, so you've plugged in the reporting script, but your not seeing any failures in Appfail. Have you written perfect Javascript code, or is something going wrong!?

You can fire a 'test' exception at appfail from your page, by adding the following value to your page's query string: http://myurl.com/somepage?appfail-report-test-exception=1

Configuration

Appfail's reporting module can be configured by modifying the query string of the URL in the <script /> tag, or by calling a javascript function.

Settings that can be configured, and their defaults:

appfail.configure({
	slug: 'abc123', 			// your app slug
	processInterval: 10, 	// how often the errors should be sent to the server (try not to DDoS it!)
	daysToStore: 7,			// number of days before stored errors are invalidated
	onBeforeStore: null		// function to parse the report values before it's stored or sent to the server
});

Query string Each of these settings can be configured via the query string of the URL in the <script /> include.

<script type="text/javascript" src="https://s3.amazonaws.com/appfail-us/appfail.reporting.min.js?slug=abc123"></script>

The following functions are exposed

  • appfail.reporting.catchManual(e) use with a try {} catch(e) {}
  • appfail.reporting.processQueue() for manually sending the queue of errors
  • appfail.reporting.storeQueue() push the current messageQueue to localStorage
  • appfail.reporting.loadStoredErrors() restore the saved errors from localStorage to the internal messageQueue. Note: This does not automatically run processQueue, and will need to be manually triggered.

Links & Resources

The REST API for Appfail is documented here: http://support.appfail.net/kb/rest-api-for-reporting-failures/rest-api-documentation-for-failure-reporting

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.