The GetErrorDetails method returns the details of the error (if available), if an error occurred when the invoked command was executed.
_bstr_t strErrorDetails = spIAppIntRsp->GetErrorDetails();
...
// Determine if the command failed, before accessing response component data
hResult = spIAppIntRsp->GetHResult();
if (FAILED(hResult)) {
std::cout << "The command failed to execute." << std::endl;
// Examine the error information provided in the standard response component
_bstr_t bstrErrorName = spIAppIntRsp->GetErrorName();
std::cout << "ErrorName=" << ( bstrErrorName.length() ? (LPCSTR) bstrErrorName : _T( "" ) ) << std::endl;
_bstr_t bstrErrorMsg = spIAppIntRsp->GetErrorMsg();
std::cout << "ErrorMsg=" << ( bstrErrorMsg.length() ? (LPCSTR) bstrErrorMsg : _T( "" ) ) << std::endl;
_bstr_t bstrErrorDetails = spIAppIntRsp->GetErrorDetails();
std::cout << "ErrorDetails=" << ( bstrErrorDetails.length() ? (LPCSTR) bstrErrorDetails : _T( "" ) ) << std::endl;
_ASSERTE(0);
} else {
...
}
...