Skip to content

Accessing return values when a method return Uncertain #1815

Open
@olofos

Description

@olofos

Both the call_method and call_method_full functions throw an exception if the status is not Ok, which means that it is not possible to see the return value of an Uncertain result. As far as I understand the spec if a method returns an Uncertain status it indicates that the return values might be unreliable, but it could still be useful to examine their values.

Since most people probably only care about if the status is Ok or not I don't think it makes sense to change call_method, but maybe since call_method_full returns a CallMethodResult object, which contains the status code, maybe it makes sense for that method not to throw an exception on a not-Ok status? Or, if that breaks backwards compatibility, would it be possible to add either an additional parameter (with a default value) to call_method_full which disables the check of the return value, or a completely new function to do this?

For a real world use case of this, see the "Joining Systems Base" companion spec. The methods defined there have status and statusMessage return values, and in case of error the the OPC UA status is set to Uncertain and these return values describe the error in more detail. See eg the EnableAsset method and the discussion about the status

I'm happy to provide a pull request with the above proposed changes, but first want some input about what sort of API the developers would prefer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions