improve error handling and logging
This commit is contained in:
parent
a6594f142b
commit
cebfae6430
1 changed files with 3 additions and 3 deletions
6
dist/static/assets/webcam.js
vendored
6
dist/static/assets/webcam.js
vendored
|
@ -457,12 +457,12 @@ if (event.reason && event.reason.message && event.reason.stack){
|
||||||
|
|
||||||
(function(){
|
(function(){
|
||||||
const oldLog = console.log;
|
const oldLog = console.log;
|
||||||
console.log = function () {
|
console.log = function (...params) {
|
||||||
oldLog.apply(console, arguments);
|
oldLog.apply(console, params);
|
||||||
|
|
||||||
const err = new Error();
|
const err = new Error();
|
||||||
const logSrc = err.stack.split("\n")[1];
|
const logSrc = err.stack.split("\n")[1];
|
||||||
const args = arguments.map((a) => ""+a); // to string
|
const args = params.map((a) => ""+a); // to string
|
||||||
window.parent.postMessage([{
|
window.parent.postMessage([{
|
||||||
log: [{
|
log: [{
|
||||||
method: 'log',
|
method: 'log',
|
||||||
|
|
Loading…
Reference in a new issue