python-opcua icon indicating copy to clipboard operation
python-opcua copied to clipboard

Regarding Handling Exceptions of " Service Fault Recieved from server"

Open rajnishnationfirst opened this issue 3 years ago • 2 comments

Hi colleagues ,

I need a help from you all regarding handling Service Fault Received from server while waiting for publish response for freeopcua example of client .

I know we can handle the opcua errors by the below code :

 except ua.UaError as error:
        print("OPCUA Error OPCUA Error Raised Past", error

But i need to handle the errors like - Service Fault Received from server while waiting for publish response with respect to the below function of client-minimal example.py - datachange_notification or if anyone can suggest where to put the exception try catch with what exception to handle - Service Fault Received from server while waiting for publish response

Pls help me to support on this as i am in frustration mode now . Pls support guys.

image


class SubHandler(object):


    def datachange_notification(self, handle, node, val):

        import logging
        logging.basicConfig(level=logging.DEBUG)

        if node is True:
            activate_Shift_Wise_Breakdown(handle)

        elif node is False:

            close_Breakdown_Automatically(handle)

rajnishnationfirst avatar Apr 05 '22 10:04 rajnishnationfirst

@rajnishnationfirst I'm having this same issue. have you found an appropriate place to put the exception handling in the code?

kBashar avatar Jul 15 '22 09:07 kBashar

you cannot catch service faults unfortunately. We do not know where to forward that info. Your client might do absolutely nothing at that point. so your only way to detect an issue is to pull manually the server status node (or another node)

oroulet avatar Jul 15 '22 11:07 oroulet