Add function to return real error from OPC DA
Hello! I need to get the real OPC DA connection error, as well as other errors, but in the current logic of the code you just check the error and return a pre-formatted string saying, for example, that the connection failed, and I believe that the return informs if was the problem with the machine or was it with the server, was it between communication and other important factors for debuggin
Ex:
I did a test and just added this to the failed connection line of code:
return nil, errors.New(fmt.Sprintf("Connection failed %v", err.Error()))
And the feedback was very good:
Yes, that's a good idea. Would you like to submit your changes as a PR?
If so, please create the errors with fmt.Errorf("Connection failed: %w", err) and also update the logger output.