﻿//------------------------------------------------------------
// Xelo - to deal with the fking script errors 
// Catch and suppress all error messages and do nothing
//------------------------------------------------------------
function noErrorMessagesplease () { return true; }
window.onerror = noErrorMessagesplease;
//------------------------------------------------------------
// advanced handler: full error handler
//------------------------------------------------------------
function handleError (err, url, line, msg) {
    if (err.indexOf('is not defined') != -1) {
      alert('Caramba que paso, algo no esta definido.\\n' +
             err + '\n' + url + '\nline no: ' + line);
      return true; // Si=  error is handled
    }
    else
      return false; // No = let the browser handle the error
  }
window.defaultOnError = window.onerror; // store default handler
window.onerror = handleError; // assign to own handler

//.. executing the faulty script code
window.onerror = window.defaultOnError;  // restore default handler

 
