Hello,
I’m trying to display more information from an Exception in a messageBox instead of the Ignition error window. The java.lang Exception is from execSProcCall but in that stored procedure I’m raising specific errors in my T-SQL logic. The message I want to display is caused by a GatewayException but I don’t know how to get that value. Here is my code:
from java.lang import Exception
if event.keyCode == event.VK_ENTER:
try:
call = system.db.createSProcCall("dbo.usp_Handle_Badge_Swipe")
call.registerInParam(1, system.db.TINYINT, event.source.parent.Badge_ID)
system.db.execSProcCall(call)
except Exception, value:
from com.inductiveautomation.ignition.client.gateway_interface import GatewayException
system.gui.messageBox("Error: %s" % value) #I want the GatewayException value, not the Exception value here
This returns a messageBox with what’s expected - “Error: java.lang.Exception: Error executing system.db.execSProcCall()”. But what I’m after is the following error raised in my stored procedure and I don’t know the syntax to get it:
Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Badge 123456 is not valid for any user.
Thanks in advance,
Steve