Hello,
When calling system.db.execSProcCall(call)
with incorrect parameters to the procedure, the stacktrace produces a generic java.lang.Exception: Error executing system.db.execSProcCall()
To find the underlying reason that the SP call failed, I need to log the exception to ignition, and look at the backtrace.
I understand that this is a Java backtrace, not a Jython one, but I would like to return the backtrace to the calling function so it knows how the SP called failed, and not have to go to the logs to find out why. Is this possible?
I checked this post, as well as the SDK docs with no luck.
Below is an example snippet for clarification. I would like to extract the backtrace from e
import java.lang.Exception
try:
call = system.db.createSProcCall("pr_someProc")
call.registerInParam("column1", system.db.NVARCHAR, value1)
call.registerInParam("column2", system.db.NVARCHAR, value2)
call.registerInParam("column3", system.db.NVARCHAR, value3)
call.registerReturnParam(system.db.INTEGER)
system.db.execSProcCall(call)
except java.lang.Exception, e:
system.util.getLogger("genericlogger").error("FailedSPCall", e)
# extract the backtrace from e
return e.someFunc()
Thanks in advance