I have a remote agent and it is missing a message handler. This is by design. I will add the message handler later but in the meantime I want to capture the error that the sendRequest throws in the following try/except. However the following does not capture this error like I expect. In this case the error text should log and instead I get the normal pop up with a bunch of red with a clear description that the message handler does not exist on the remote gateway. Is there a way to capture this type of error?
result = None
try:
result = system.util.sendRequest(project, messageHandler, payload, agent, timeoutSec)
except Exception as e:
L.warn("An error occured while sending '%s' to '%s'" % (functionName, agent))
L.warn("Error: %s" % str(e))
return result