forked from jaystack/jaydata
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrorhandler.js
More file actions
26 lines (21 loc) · 968 Bytes
/
errorhandler.js
File metadata and controls
26 lines (21 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import $data, { $C, Guard, Container, Exception, MemberDefinition } from 'jaydata/core';
(function(){
$data.__global.onerror = function(msg, url, line){
alert('Error' + (line ? ' in line ' + line : '') + '\n' + (url || '') + '\n' + msg);
};
/*$data.__global.onerror = function(msg, url, line){
var html = '<div class="error"><span class="url">{url}</span><p class="msg">{msg}</p><span class="line">{line}</span></div>';
html = html.replace('{url}', url || '');
html = html.replace('{msg}', msg || '');
html = html.replace('{line}', line || '');
var container = document.querySelector ? document.querySelector('.jaydata-errorhandler') : document.getElementsByClassName('jaydata-errorhandler')[0];
if (!container){
container = document.createElement('DIV');
container.innerHTML = '';
container.className = 'jaydata-errorhandler';
document.body.appendChild(container);
}
container.innerHTML += html;
};*/
})();
export default $data