Openbravo Issue Tracking System - Retail Modules
View Issue Details
0027318Retail ModulesWeb POSpublic2014-08-12 23:372014-09-22 16:24
mtaal 
adrianromero 
normalminorhave not tried
newopen 
5
 
 
No
No
0027318: OB.UTIL.getStackLink throws error
See info below, the getStackLink method is like this:
 OB.UTIL.getStackLink = function () {
    try {
      var errorobj = new Error();
      var link = errorobj.stack.split('\n')[4].split('(')[1];
      link = link.substring(0, link.length - 2);
      return link;
    } catch (e) {
      return '';
    }
  };
With this errorobj.stack content the link var is undefined:

"Error
    at Object.OB.UTIL.getStackLink (http://188.226.181.203/openbravo/web/js/gen/a41ff86411367a017a4fc7fe32c93d06.js:6323:22 [^])
    at Object.OB.UTIL.saveLogClient (http://188.226.181.203/openbravo/web/js/gen/a41ff86411367a017a4fc7fe32c93d06.js:6236:44 [^])
    at Object.OB.error (http://188.226.181.203/openbravo/web/js/gen/a41ff86411367a017a4fc7fe32c93d06.js:6168:17 [^])
    at http://188.226.181.203/openbravo/web/js/gen/a41ff86411367a017a4fc7fe32c93d06.js:1105:12 [^]
    at serviceError (http://188.226.181.203/openbravo/web/js/gen/a41ff86411367a017a4fc7fe32c93d06.js:850:7 [^])
    at Object.enyo.Ajax.fail (http://188.226.181.203/openbravo/web/js/gen/a41ff86411367a017a4fc7fe32c93d06.js:914:9 [^])
    at Object.enyo.kind.receive (http://188.226.181.203/openbravo/web/org.openbravo.mobile.core/enyo/source/ajax/Ajax.js:87:10 [^])
    at XMLHttpRequest.inXhr.onreadystatechange (http://188.226.181.203/openbravo/web/org.openbravo.mobile.core/enyo/source/ajax/xhr.js:71:16 [^])"
Make the method simpler by removing the split('(') and the substring.

 OB.UTIL.getStackLink = function () {
    try {
      var errorobj = new Error();
      return errorobj.stack.split('\n')[4];
    } catch (e) {
      return '';
    }
  };
No tags attached.
Issue History
2014-08-12 23:37mtaalNew Issue
2014-08-12 23:37mtaalAssigned To => adrianromero
2014-08-12 23:37mtaalOBNetwork customer => No
2014-08-12 23:37mtaalTriggers an Emergency Pack => No
2014-09-22 16:24mtaalTarget VersionRR14Q4 =>

There are no notes attached to this issue.