Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Unexpected error not getting caught in try/catch block
I am trying to catch an unexpected error in a try/catch block. nlobjError objects are caught and handled successfully, however for some reason system errors skip my error handling.
A quick test:
<span style="color:'#000080'"><strong>try </strong></span>{ <em> nlapiLogExecution</em>(<span style="color:'#008000'"><strong>'debug'</strong></span>,<span style="color:'#008000'"><strong>'started test'</strong></span>; //note that we're missing a paren. This is intentional. } <span style="color:'#000080'"><strong>catch</strong></span>(e) { <span style="color:'#000080'"><strong>if</strong></span>(e <span style="color:'#000080'"><strong>instanceof </strong></span><em>nlobjError</em>) { <em>nlapiLogExecution</em>(<span style="color:'#008000'"><strong>'debug'</strong></span>,<span style="color:'#008000'"><strong>'nlobjError')</strong></span>; } <span style="color:'#000080'"><strong>else </strong></span>{ nlapiLogExecution('debug', 'error filename returned is'); } <span style="color:'#252C2F'"><span style="font-family:'Helvetica'"><span style="font-size:'13px'">}</span></span></span> 0