public class ServiceException extends UaException
On client-side, read the ServiceResult to check which error occurred during a call to an OPC UA service.
On server side, generate these exceptions to make the server return the error.
The standard error codes are defined in StatusCodes.
| Constructor and Description |
|---|
ServiceException(ServiceFaultException cause)
Creates a new ServiceException from a ServiceFaultException.
|
ServiceException(ServiceResultException cause)
Creates a new ServiceException from a ServiceResultException.
|
ServiceException(StatusCode statusCode)
Creates a new Service Result Exception.
|
ServiceException(StatusCode statusCode,
DiagnosticInfo diagnosticInfo)
Creates a new Service Result Exception.
|
ServiceException(String msg)
Creates a new Service Result Exception with StatusCode = Bad_UnexpectedError.
|
ServiceException(String msg,
ServiceFaultException cause)
Creates a new ServiceException from a ServiceFaultException overriding the message with the
given one.
|
ServiceException(String msg,
ServiceResultException cause)
Creates a new ServiceException from a ServiceResultException overriding the message with the
given one.
|
ServiceException(String msg,
StatusCode statusCode)
Creates a new Service Result Exception.
|
ServiceException(String msg,
StatusCode statusCode,
DiagnosticInfo diagnosticInfo,
Throwable cause)
Creates a new Service Result Exception.
|
ServiceException(String msg,
UnsignedInteger statusCode)
Creates a new Service Result Exception.
|
ServiceException(String msg,
UnsignedInteger statusCode,
DiagnosticInfo diagnosticInfo,
Throwable cause)
Creates a new Service Result Exception.
|
ServiceException(UnsignedInteger statusCode)
Creates a new Service Result Exception.
|
| Modifier and Type | Method and Description |
|---|---|
DiagnosticInfo |
getDiagnosticInfo()
Returns the
DiagnosticInfo of the failure, if any. |
StatusCode |
getServiceResult()
Returns the failure
StatusCode. |
String |
toString() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTracepublic ServiceException(ServiceFaultException cause)
public ServiceException(ServiceResultException cause)
public ServiceException(StatusCode statusCode)
statusCode - The error status code defining the actual service call error.public ServiceException(StatusCode statusCode, DiagnosticInfo diagnosticInfo)
statusCode - The error status code defining the actual service call error.diagnosticInfo - The diagnostic info for the exceptionpublic ServiceException(String msg)
msg - Error message.public ServiceException(String msg, ServiceFaultException cause)
public ServiceException(String msg, ServiceResultException cause)
public ServiceException(String msg, StatusCode statusCode)
msg - Error message.statusCode - The error status code value defining the actual service call error.public ServiceException(String msg, StatusCode statusCode, DiagnosticInfo diagnosticInfo, Throwable cause)
msg - Error message.statusCode - The error status code defining the actual service call error.diagnosticInfo - The additional diagnostic information as returned from the server.cause - the original exceptionpublic ServiceException(String msg, UnsignedInteger statusCode)
msg - Error message.statusCode - The error status code value defining the actual service call error.public ServiceException(String msg, UnsignedInteger statusCode, DiagnosticInfo diagnosticInfo, Throwable cause)
msg - Error message.statusCode - The error status code value defining the actual service call error.cause - The original exceptionpublic ServiceException(UnsignedInteger statusCode)
statusCode - The error status code value defining the actual service call error.public DiagnosticInfo getDiagnosticInfo()
DiagnosticInfo of the failure, if any.public StatusCode getServiceResult()
StatusCode.Copyright © 2026. All rights reserved.