JavaScript Debugging

JavaScript Debugging

  

Hi, i try to follow this instruction to debug javascript:

https://success.outsystems.com/Documentation/10/Extensibility_and_Integration/JavaScript/Extend_Your_Web_Application_Using_JavaScript/Define_and_Run_JavaScript_Code

Unfortunately, i cannot write a javascript code that throw an error.

My javascript in a button click:

SyntaxEditor Code Snippet

function tryMe(msg){
    alert("in tryMe");
    throw 600;
    return true;
}

and my debug handler is:

SyntaxEditor Code Snippet

function IBJSDebug(event, excp, error_code, origin){
    alert("ERROR CODE #" + error_code + "\n" + origin + 
    "Exception.\nName:" + excp.name +
    "\nMessage:" + excp.message);
}

osRegisterExceptionHandler(IBJSDebug);

When i click the button, the handler is not executed.

How to make a javascript code that is error so that can be caught by the handler? thank you.

regards,

O

Is there someone who try the handler? Tq

Solution

Hi Putu,


javascript is always case sensitive 

Correct function is "OsRegisterExceptionHandler" 

what you have is "osRegisterExceptionHandler"

"O" is the difference


Thanks,

Balu

Solution

Thank you Balu, 

I will try it later