Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 76 lines (47 sloc) 2.907 kb
446d3025 »
2010-09-05 init
1
c607fadf »
2010-09-26 added javascript-stack trace info
2 # jquery.flawed.js
446d3025 »
2010-09-05 init
3
c607fadf »
2010-09-26 added javascript-stack trace info
4 Flawed is a very small jquery plugin for reporting client side errors.
446d3025 »
2010-09-05 init
5
29182f85 »
2010-09-16 readme and some small changes
6 ## Why?
7
02636eae »
2010-09-17 removed external lib dependencies
8 No one writes perfect code, and client side developers needs the same error visibility that server side folks have in spades.
29182f85 »
2010-09-16 readme and some small changes
9
10 ## Setup
11
12 On the client, just use flawed to wrap your js where you would normally use an anonymous function:
13
c607fadf »
2010-09-26 added javascript-stack trace info
14 $.flawed(function(){
29182f85 »
2010-09-16 readme and some small changes
15 // insert your flawed javascript here
16 })();
17
c607fadf »
2010-09-26 added javascript-stack trace info
18 Server side, with flawed's default configuration, simply handle POST requests at the root of your application for requests with the header 'x-jquery-flawed-stack'.
29182f85 »
2010-09-16 readme and some small changes
19
20 Changing the default path is recommended:
21
96c1405e »
2010-10-22 moved config.ajax to config.request
22 $.flawed.config.request.path = '/your/path/here' // default '/'
29182f85 »
2010-09-16 readme and some small changes
23
24 Other settings include:
25
96c1405e »
2010-10-22 moved config.ajax to config.request
26 $.flawed.config.request.type // 'POST', 'GET', etc
c607fadf »
2010-09-26 added javascript-stack trace info
27 $.flawed.config.header // default: 'x-jquery-flawed-stack'
28
29 ## javascript-stacktrace
30
31 If the `printStackTrace` function is defined on the window object, it will be used to provide cross browser stack trace information. If not, the stack property of the data transmitted to the server will simply be the the error object caught within flawed's anonymous function.
32
33 For more information on javascript-stacktrace see the [github page](http://github.com/emwendelin/javascript-stacktrace).
29182f85 »
2010-09-16 readme and some small changes
34
7e12dc63 »
2010-09-17 updated the readme for the examples
35 ## Handlers
36
37 You can see a simple Rack app with a middleware for handling the reports in the examples directory. If you want to run it issue the following (you'll need ruby and bundler):
38
39 $ bundle install
40 $ ruby examples/server.rb
41
c607fadf »
2010-09-26 added javascript-stack trace info
42 You can then access the index file at localhost:4567/examples/index.html, and watch the stack trace information at the command line.
7e12dc63 »
2010-09-17 updated the readme for the examples
43
c607fadf »
2010-09-26 added javascript-stack trace info
44 ## Tests
3d3e27ca »
2010-09-17 tests and an example rack app, page, and exception throwing js
45
46 $ cd ~/path/to/flawed/
93896958 »
2010-09-26 readme updates, small tweak to the server.rb and index.html examples
47 $ firefox spec/dom.html
3d3e27ca »
2010-09-17 tests and an example rack app, page, and exception throwing js
48
49 ## TODO
50
7e12dc63 »
2010-09-17 updated the readme for the examples
51 1. Provide a Rack middleware for use with [Radar](http://github.com/mitchellh/radar)
3d3e27ca »
2010-09-17 tests and an example rack app, page, and exception throwing js
52
29182f85 »
2010-09-16 readme and some small changes
53 ## License
446d3025 »
2010-09-05 init
54
55 (The MIT License)
56
57 Copyright (c) 2009 Your Name <Your Email>
58
59 Permission is hereby granted, free of charge, to any person obtaining
60 a copy of this software and associated documentation files (the
61 'Software'), to deal in the Software without restriction, including
62 without limitation the rights to use, copy, modify, merge, publish,
63 distribute, sublicense, and/or sell copies of the Software, and to
64 permit persons to whom the Software is furnished to do so, subject to
65 the following conditions:
66
67 The above copyright notice and this permission notice shall be
68 included in all copies or substantial portions of the Software.
69
70 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
71 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
72 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
73 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
74 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
75 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
29182f85 »
2010-09-16 readme and some small changes
76 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.