cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to return failure from a Program Object with a log

Former Member
0 Likes
766

I would like to write a Java JAR file that implements IProgramBase (or IProgramBaseEx). These interfaces require that your class implement one method

void run(...) throws SDKException { ... }

. And therein lies the problem, the method can only return

void

and can only throw an

SDKException

.

The program I need to write may fail, and I would want someone to know that that has occurred. However, even if I throw an exception from within my program and use

System.out.println(...)

, the program's status returns success, while the log contains the exception message and stack trace.

I have managed to catch my exceptions and attempt to throw an SDK exceptoin, such as

SDKException.UnexpectedException(Throwable ex)

. However, all that results in is the program's status set to Failed (which is one thing that I want) and the very generic error message

An unexpected exception has occurred

. Even though the UnexpectedException takes a Throwable as an "inner" exception, the inner exception stack trace and/or error message is never displayed anywhere. Worse, there is no log file to access to see any stack traces in addition to the primary (outer) exception.

Is it even possible to tell Business Objects that a program object should return a status of Failed and have a log file for JAR-generated failures (as opposed to Business Objects failing to run the program object at all)?

Regards,

CS.

View Entire Topic
Former Member
0 Likes

Thank you Robert and Ryan for following up on this. All of the information you provided was very helpful and will continue to be very helpful.