QOpcUaErrorState Class

QOpcUaErrorState allows investigation and interaction with error state from backends. More...

Header: #include <QOpcUaErrorState>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua
Since: QtOpcUa 5.13

Public Types

enum class ConnectionStep { Unknown, CertificateValidation, OpenSecureChannel, CreateSession, ActivateSession }

Public Functions

QOpcUaErrorState(const QOpcUaErrorState &other)
QOpcUaErrorState::ConnectionStep connectionStep() const
QOpcUa::UaStatusCode errorCode() const
bool ignoreError() const
bool isClientSideError() const
void setClientSideError(bool clientSideError)
void setConnectionStep(QOpcUaErrorState::ConnectionStep step)
void setErrorCode(QOpcUa::UaStatusCode error)
void setIgnoreError(bool ignore = true)
QOpcUaErrorState &operator=(const QOpcUaErrorState &rhs)

Detailed Description

There is not need to instantiate this class in your code. A client will emit an error state via QOpcUaClient::connectError in case an error has happened while establishing a connection.

The error can be caused by the backend itself or by the server rejecting the connection. If case of errors issued by the local backend, they can be ignored by calling the function setIgnoreError().

Member Type Documentation

enum class QOpcUaErrorState::ConnectionStep

Specifies at which step during the connection establishment the error occurred.

ConstantValueDescription
QOpcUaErrorState::ConnectionStep::Unknown0x00The connection step is unknown.
QOpcUaErrorState::ConnectionStep::CertificateValidation0x1Error happened in the certificate validation step.
QOpcUaErrorState::ConnectionStep::OpenSecureChannel0x2Error happened when opening the secure channel.
QOpcUaErrorState::ConnectionStep::CreateSession0x3Error happened when creating the session.
QOpcUaErrorState::ConnectionStep::ActivateSession0x4Error happened during session acivation.

Member Function Documentation

QOpcUaErrorState::QOpcUaErrorState(const QOpcUaErrorState &other)

Constructs an error state from other.

QOpcUaErrorState::ConnectionStep QOpcUaErrorState::connectionStep() const

Returns the connection step in which the error occurred.

See also setConnectionStep().

QOpcUa::UaStatusCode QOpcUaErrorState::errorCode() const

Returns the OPC UA status code of the error occurred.

See also setErrorCode().

bool QOpcUaErrorState::ignoreError() const

Returns if this client side error should be ignored.

See also setIgnoreError().

bool QOpcUaErrorState::isClientSideError() const

Returns if the occurred error is a client side error.

void QOpcUaErrorState::setClientSideError(bool clientSideError)

Sets if the occurred error is a client side error to clientSideError.

See also isClientSideError().

void QOpcUaErrorState::setConnectionStep(QOpcUaErrorState::ConnectionStep step)

Sets the connection step in which the error occurred to step.

See also connectionStep().

void QOpcUaErrorState::setErrorCode(QOpcUa::UaStatusCode error)

Sets the OPC UA status code of the error occurred to error.

See also errorCode().

void QOpcUaErrorState::setIgnoreError(bool ignore = true)

Sets if this client side error should be ignored to ignore.

Setting this flag does only work if the error is actually a client side error.

See also ignoreError().

QOpcUaErrorState &QOpcUaErrorState::operator=(const QOpcUaErrorState &rhs)

Sets the values of rhs in this error state.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.