there has been a very interesting discussion about when to use try/catch sequences in this forum:
wMUser ‘nath’ was talking about throwing exceptions back to the parent service. How is this done in Developer? Just leave out the try-catch-sequences? Where can I then (as in Java) deposit the e.g. “throws FileNotFoundException, IOException” statement?
And another question:
I’m using the EventHandler to react to exception events. The Developer User’s Guide describes the following:
“When the Event Manager invokes an event handler for an exception event, the event handler receives an IData object …”, see also specification pub.event:exception or doc type pub.event:exceptionInfo. This accords to the output of service pub.flow:getLastError.
Within the ExceptionHandlerService I try to log the error message and the name of the service causing the error, but there is only %serviceName% (variable substitution is enabled) in the log message.
So, does anyone know if getLastError (that is not called in my scenario) has to be explicitly called before or is this done “built-in” by IS?
Thanks in advance for any hints.