Improved logged JavaScript error message
This commit is contained in:
parent
2af014dad2
commit
1aea4d83a2
1 changed files with 2 additions and 1 deletions
|
|
@ -30,11 +30,12 @@
|
|||
NINJA.isRegistered = {{ Utils::isRegistered() ? 'true' : 'false' }};
|
||||
|
||||
window.onerror = function(e) {
|
||||
var message = e.message ? (e.message + ' - ' + e.filename + ': ' + e.lineno) : e;
|
||||
try {
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '{{ URL::to('log_error') }}',
|
||||
data: 'error='+encodeURIComponent(e.message + ' - ' + e.filename + ': ' + e.lineno)+'&url='+encodeURIComponent(window.location)
|
||||
data: 'error='+encodeURIComponent(message)+'&url='+encodeURIComponent(window.location)
|
||||
});
|
||||
} catch(err) {}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue