Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The error line and details are not easily accessible from requestScope.error. If you look at the source code for the latest release of Mark Leusink's Debug Toolbar, you'll see he's parsing the stack trace to get the details.</p> <p>However, you can access all the relevant information using the underlying Java class for the SSJS exception - com.ibm.jscript.InterpretException using getErrorLine(). The getLocalizedMessage() method gets the error detail that usually starts "Script interpreter error". The getExpressionText() method retrieves the line that threw the error.</p> <p>If you take a look at the XPages OpenLog Logger project I put on OpenNTF, that's what I use to log full details to OpenLog. <a href="http://www.openntf.org/Internal/home.nsf/project.xsp?action=openDocument&amp;name=XPages%20OpenLog%20Logger" rel="nofollow">http://www.openntf.org/Internal/home.nsf/project.xsp?action=openDocument&amp;name=XPages%20OpenLog%20Logger</a></p> <p>You can see the source code of the OpenLogPhaseListener which uses those methods here: <a href="https://github.com/paulswithers/openlogjava/blob/master/OpenLogJava/WebContent/WEB-INF/src/com/paulwithers/openLog/OpenLogPhaseListener.java" rel="nofollow">https://github.com/paulswithers/openlogjava/blob/master/OpenLogJava/WebContent/WEB-INF/src/com/paulwithers/openLog/OpenLogPhaseListener.java</a></p> <p>Even if you're not a Java expert, from use of SSJS the key parts should be understandable. Line 84 captures uncaught exceptions - when XPages routes to the default error page. That uses the methods I mentioned.</p> <p>Lines 98 to 105 are the ones that log out all the details if you just use a catch block, passing <code>OpenLogBean.addError(e, this)</code> where <code>e</code> is the error object and <code>this</code> is the component the error occurs on. error.getError() in the Java code retrieves that error object. To get the typeahead in SSJS you'll need to use <code>catch(e:com.ibm.jscript.InterpretException)</code> I believe.</p> <p>I haven't tested this, I've just working back from what I used for the project on OpenNTF.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload