Show More
@@ -1,57 +1,54 b'' | |||||
1 | {% extends "/layout.jinja2" %} |
|
1 | <!DOCTYPE html> | |
2 | {% from '/reports/reports_small_list_old.jinja2' import render_reports with context %} |
|
2 | <html lang="en"> | |
3 | {% block additional_layout_scripts %} |
|
3 | <head> | |
4 | <script src="/static/scripts/jerrormator.js" type="text/javascript"></script> |
|
4 | <meta charset="utf-8"> | |
5 | {% endblock %} |
|
|||
6 | {% block content_class %}{% endblock %} |
|
|||
7 | {% set layout_disable_menu = True %} |
|
|||
8 |
|
5 | |||
9 | {% block additional_styles %} |
|
6 | <title>Error test</title> | |
|
7 | <meta name="description" content=""> | |||
|
8 | </head> | |||
|
9 | <body> | |||
|
10 | ||||
|
11 | <h1>Error test</h1> | |||
10 |
|
12 | |||
11 |
|
13 | |||
12 | <script type="text/javascript"> |
|
14 | <script type="text/javascript"> | |
13 | (function(callback) { |
|
15 | (function(callback) { | |
14 | var ab = document.createElement('script'); |
|
16 | var ab = document.createElement('script'); | |
15 | ab.type = 'text/javascript'; ab.async = true; |
|
17 | ab.type = 'text/javascript'; ab.async = true; | |
16 | ab.onload = ab.onreadystatechange = callback; |
|
18 | ab.onload = ab.onreadystatechange = callback; | |
17 | // this should match your copy of the compiled notifier.js or notifier.min.js |
|
19 | // this should match your copy of the compiled notifier.js or notifier.min.js | |
18 | //ab.src = (("https:" == document.location.protocol) ? "https://ssljscdn" : "http://jscdn") + ".airbrake.io/notifier.min.js"; |
|
20 | //ab.src = (("https:" == document.location.protocol) ? "https://ssljscdn" : "http://jscdn") + ".airbrake.io/notifier.min.js"; | |
19 | ab.src = "/static/scripts/notifier.js"; |
|
21 | ab.src = "/static/scripts/notifier.js"; | |
20 | var p = document.getElementsByTagName('script')[0]; |
|
22 | var p = document.getElementsByTagName('script')[0]; | |
21 | p.parentNode.insertBefore(ab, p); |
|
23 | p.parentNode.insertBefore(ab, p); | |
22 | }(function () { |
|
24 | }(function () { | |
23 | Airbrake.setGuessFunctionName(true); |
|
25 | Airbrake.setGuessFunctionName(true); | |
24 | Airbrake.setHost('api.appenlight.com'); |
|
26 | Airbrake.setHost('api.appenlight.com'); | |
25 | console.log(Airbrake) |
|
27 | console.log(Airbrake) | |
26 | // insert your public api key |
|
28 | // insert your public api key | |
27 | Airbrake.setKey('1ec3119102154a8caaa307a4495b8558'); |
|
29 | Airbrake.setKey('{{ request.registry.settings.get('appenlight.public_api_key') }}'); | |
28 | Airbrake.setEnvironment('production'); |
|
30 | Airbrake.setEnvironment('production'); | |
29 | Airbrake.setErrorDefaults({ |
|
31 | Airbrake.setErrorDefaults({ | |
30 | url: document.URL, |
|
32 | url: document.URL, | |
31 | component: "", |
|
33 | component: "", | |
32 | action: "", |
|
34 | action: "", | |
33 | user: "someuser", |
|
35 | user: "someuser", | |
34 | }); |
|
36 | }); | |
35 | })); |
|
37 | })); | |
36 | // example error |
|
38 | // example error | |
37 | setTimeout(function(){ |
|
39 | setTimeout(function(){ | |
38 | try { |
|
40 | try { | |
39 | cvxzvcxzcvxv + 263 |
|
41 | cvxzvcxzcvxv + 263 | |
40 | } catch (e) { |
|
42 | } catch (e) { | |
41 | window.Airbrake.captureException(e); |
|
43 | window.Airbrake.captureException(e); | |
42 | } |
|
44 | } | |
43 | console.log('foo'); |
|
45 | console.log('foo'); | |
44 | },2000); |
|
46 | },2000); | |
45 |
|
47 | |||
46 |
|
48 | |||
47 |
|
49 | |||
48 |
|
50 | |||
49 | </script> |
|
51 | </script> | |
50 | {% endblock %} |
|
|||
51 |
|
||||
52 | {% block page_title %} |
|
|||
53 | <h1 class="page-title">{{_('JS')}}</h1> |
|
|||
54 | {% endblock %} |
|
|||
55 | {% block content %} |
|
|||
56 |
|
52 | |||
57 | {% endblock %} |
|
53 | </body> | |
|
54 | </html> |
@@ -1,53 +1,81 b'' | |||||
1 | {% extends "/layout.jinja2" %} |
|
1 | <!DOCTYPE html> | |
2 | {% block dojodeps %} |
|
2 | <html lang="en"> | |
3 | deps: ["appenlight","appenlight/sections/test_error"] |
|
3 | <head> | |
4 | {% endblock %} |
|
4 | <meta charset="utf-8"> | |
5 |
|
5 | |||
6 | {% block additional_layout_scripts %} |
|
6 | <title>Error test</title> | |
|
7 | <meta name="description" content=""> | |||
|
8 | {% if request.registry.settings.get('appenlight.public_api_key') %} | |||
|
9 | <script type="application/javascript"> | |||
|
10 | var initAppEnlight = function () { | |||
|
11 | if(this.readyState!='loading'){ | |||
|
12 | AppEnlight.init({ | |||
|
13 | apiKey:'{{ request.registry.settings.get('appenlight.public_api_key') }}', | |||
|
14 | windowOnError: 1 // enable to hook to window.onerror | |||
|
15 | }); | |||
|
16 | // setting request info is completly optional | |||
|
17 | AppEnlight.setRequestInfo({ | |||
|
18 | server:"{{ request.environ.get('SERVER_NAME', '<unknown>') }}", | |||
|
19 | {% if request.user %} | |||
|
20 | username:'{{ request.user.user_name }}', | |||
|
21 | {% endif %} | |||
|
22 | ip: "{{ request.environ.get('REMOTE_ADDR', '') }}", | |||
|
23 | request_id:"{{ request.environ.get('appenlight.request_id', '') }}" | |||
|
24 | }); | |||
7 |
|
25 | |||
8 | {% endblock %} |
|
26 | AppEnlight.addGlobalTags({framework:'angular', 'language':'javascript'}); | |
9 | {% block content_class %}{% endblock %} |
|
27 | AppEnlight.addGlobalExtra({some_key:'on every request'}); | |
10 | {% set layout_disable_menu = True %} |
|
|||
11 |
|
28 | |||
12 | {% block additional_styles %} |
|
29 | } | |
13 | <script type="text/javascript"> |
|
30 | }; | |
|
31 | // load the script asynchroneously | |||
|
32 | var scrElem = document.createElement('script'); | |||
|
33 | scrElem.type = 'text/javascript'; | |||
|
34 | scrElem.async = true; | |||
|
35 | scrElem.onload = scrElem.onreadystatechange = initAppEnlight; | |||
|
36 | scrElem.src = "//cdn.jsdelivr.net/appenlight/latest/appenlight-client.min.js"; | |||
|
37 | scrElem.src = "/static/appenlight/js/appenlight-client.js"; | |||
|
38 | var p = document.getElementsByTagName('script')[0]; | |||
|
39 | p.parentNode.insertBefore(scrElem, p); | |||
|
40 | </script> | |||
|
41 | {% endif %} | |||
|
42 | </head> | |||
|
43 | <body> | |||
14 |
|
44 | |||
|
45 | <h1>Error test</h1> | |||
15 |
|
46 | |||
16 | function subfunction() { |
|
47 | <script type="text/javascript"> | |
17 | subsubfunction(); |
|
|||
18 | } |
|
|||
19 |
|
48 | |||
20 |
|
|
49 | function subfunction() { | |
21 | console.log('A'); |
|
50 | subsubfunction(); | |
|
51 | } | |||
22 |
|
52 | |||
23 | try { |
|
53 | function subsubfunction() { | |
24 | 1 + nonexistantvar; |
|
54 | console.log('A'); | |
25 | } catch (exc) { |
|
|||
26 | AppEnlight.grabError(exc, { |
|
|||
27 | extra: {foo: 'foo'}, |
|
|||
28 | tags: {'bar': 'aa', 'baz': 5} |
|
|||
29 | }); |
|
|||
30 | } |
|
|||
31 |
|
55 | |||
32 | //var x = 1/0 + fateqtwetew; |
|
56 | try { | |
33 | console.log('B'); |
|
57 | 1 + nonexistantvar; | |
|
58 | } catch (exc) { | |||
|
59 | AppEnlight.grabError(exc, { | |||
|
60 | extra: {foo: 'foo'}, | |||
|
61 | tags: {'bar': 'aa', 'baz': 5} | |||
|
62 | }); | |||
34 | } |
|
63 | } | |
35 |
|
64 | |||
36 | setTimeout(function () { |
|
65 | //var x = 1/0 + fateqtwetew; | |
37 | subfunction(); |
|
66 | console.log('B'); | |
38 | }, 5000); |
|
67 | } | |
39 |
|
68 | |||
|
69 | setTimeout(function () { | |||
|
70 | subfunction(); | |||
|
71 | }, 5000); | |||
40 |
|
72 | |||
41 | setTimeout(function () { |
|
|||
42 | brokenCode + 666; |
|
|||
43 | }, 3000); |
|
|||
44 |
|
73 | |||
45 | </script> |
|
74 | setTimeout(function () { | |
46 | {% endblock %} |
|
75 | brokenCode + 666; | |
|
76 | }, 3000); | |||
47 |
|
77 | |||
48 | {% block page_title %} |
|
78 | </script> | |
49 | <h1 class="page-title">{{ _('JS') }}</h1> |
|
|||
50 | {% endblock %} |
|
|||
51 | {% block content %} |
|
|||
52 |
|
79 | |||
53 | {% endblock %} |
|
80 | </body> | |
|
81 | </html> |
@@ -1,33 +1,58 b'' | |||||
1 | {% extends "/layout.jinja2" %} |
|
1 | <!DOCTYPE html> | |
2 | {% block additional_layout_scripts %} |
|
2 | <html lang="en"> | |
|
3 | <head> | |||
|
4 | <meta charset="utf-8"> | |||
|
5 | ||||
|
6 | <title>Error test</title> | |||
|
7 | <meta name="description" content=""> | |||
|
8 | {% if request.registry.settings.get('appenlight.public_api_key') %} | |||
|
9 | <script type="application/javascript"> | |||
|
10 | var initAppEnlight = function () { | |||
|
11 | if(this.readyState!='loading'){ | |||
|
12 | AppEnlight.init({ | |||
|
13 | apiKey:'{{ request.registry.settings.get('appenlight.public_api_key') }}', | |||
|
14 | windowOnError: 1 // enable to hook to window.onerror | |||
|
15 | }); | |||
|
16 | // setting request info is completly optional | |||
|
17 | AppEnlight.setRequestInfo({ | |||
|
18 | server:"{{ request.environ.get('SERVER_NAME', '<unknown>') }}", | |||
|
19 | {% if request.user %} | |||
|
20 | username:'{{ request.user.user_name }}', | |||
|
21 | {% endif %} | |||
|
22 | ip: "{{ request.environ.get('REMOTE_ADDR', '') }}", | |||
|
23 | request_id:"{{ request.environ.get('appenlight.request_id', '') }}" | |||
|
24 | }); | |||
|
25 | ||||
|
26 | AppEnlight.addGlobalTags({framework:'angular', 'language':'javascript'}); | |||
|
27 | AppEnlight.addGlobalExtra({some_key:'on every request'}); | |||
|
28 | ||||
|
29 | } | |||
|
30 | }; | |||
|
31 | // load the script asynchroneously | |||
|
32 | var scrElem = document.createElement('script'); | |||
|
33 | scrElem.type = 'text/javascript'; | |||
|
34 | scrElem.async = true; | |||
|
35 | scrElem.onload = scrElem.onreadystatechange = initAppEnlight; | |||
|
36 | scrElem.src = "//cdn.jsdelivr.net/appenlight/latest/appenlight-client.min.js"; | |||
|
37 | scrElem.src = "/static/appenlight/js/appenlight-client.js"; | |||
|
38 | var p = document.getElementsByTagName('script')[0]; | |||
|
39 | p.parentNode.insertBefore(scrElem, p); | |||
|
40 | </script> | |||
|
41 | {% endif %} | |||
|
42 | </head> | |||
|
43 | <body> | |||
|
44 | ||||
|
45 | <h1>Error test</h1> | |||
3 |
|
46 | |||
4 | {% endblock %} |
|
|||
5 |
|
||||
6 | {% block additional_styles %} |
|
|||
7 | <script type="text/javascript"> |
|
47 | <script type="text/javascript"> | |
8 | setTimeout(function(){ |
|
|||
9 | AppEnlight.log('error',"some test message"); |
|
|||
10 | AppEnlight.log('info',"some info message"); |
|
|||
11 | AppEnlight.log('warning',"some warn message"); |
|
|||
12 | },2000); |
|
|||
13 |
|
||||
14 |
|
||||
15 |
|
||||
16 |
|
48 | |||
|
49 | setTimeout(function(){ | |||
|
50 | AppEnlight.log('error',"some test message"); | |||
|
51 | AppEnlight.log('info',"some info message"); | |||
|
52 | AppEnlight.log('warning',"some warn message"); | |||
|
53 | },2000); | |||
17 |
|
54 | |||
18 | </script> |
|
55 | </script> | |
19 | {% endblock %} |
|
|||
20 |
|
||||
21 | {% block content_class %}{% endblock %} |
|
|||
22 | {% set layout_disable_menu = True %} |
|
|||
23 |
|
||||
24 |
|
||||
25 |
|
||||
26 | {% block page_title %} |
|
|||
27 | <h1 class="page-title">{{_('JS')}}</h1> |
|
|||
28 | {% endblock %} |
|
|||
29 | {% block content %} |
|
|||
30 |
|
||||
31 |
|
||||
32 |
|
56 | |||
33 | {% endblock %} |
|
57 | </body> | |
|
58 | </html> |
General Comments 0
You need to be logged in to leave comments.
Login now