Package org.metricshub.winrm.exceptions
Class WinRMFaultException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.metricshub.winrm.exceptions.WinRMClientException
org.metricshub.winrm.exceptions.WinRMFaultException
- All Implemented Interfaces:
Serializable
The remote WinRM service answered with a WSMan fault (or a non-success HTTP status).
Beyond the human-readable message, the fault is exposed programmatically:
getFaultCode() is the numeric WSManFault code (e.g. 2150858778) and
getFaultDetail() the provider-level detail text — where WMI puts mnemonics such as
WBEM_E_INVALID_CLASS or WBEM_E_INVALID_NAMESPACE that callers historically had
to extract from the message with contains().
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionWinRMFaultException(String message, int httpStatus, String faultCode, String faultReason, String faultDetail) Create the exception. -
Method Summary
Modifier and TypeMethodDescriptionGet the numeric WSManFault code, e.g.Get the detailed WSManFault message — the provider-level detail where WMI puts mnemonics such asWBEM_E_INVALID_CLASS.Get the SOAP fault reason text.intGet the HTTP status of the faulting response (typically 500 for a SOAP fault).Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
WinRMFaultException
public WinRMFaultException(String message, int httpStatus, String faultCode, String faultReason, String faultDetail) Create the exception.- Parameters:
message- the complete detail message (same format as the legacy API)httpStatus- the HTTP status of the faulting responsefaultCode- the WSManFault code, ornullwhen the response carried nonefaultReason- the SOAP fault reason text, ornullfaultDetail- the detailed WSManFault message (provider-level detail), ornull
-
-
Method Details
-
getHttpStatus
public int getHttpStatus()Get the HTTP status of the faulting response (typically 500 for a SOAP fault).- Returns:
- the HTTP status code
-
getFaultCode
Get the numeric WSManFault code, e.g.2150858778.- Returns:
- the fault code, or
nullwhen the response carried none
-
getFaultReason
Get the SOAP fault reason text.- Returns:
- the reason text, or
null
-
getFaultDetail
Get the detailed WSManFault message — the provider-level detail where WMI puts mnemonics such asWBEM_E_INVALID_CLASS.- Returns:
- the fault detail, or
null
-