/usr/include/openwsman/cpp/Exception.h is in libwsman-clientpp-dev 2.6.5-0ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | //----------------------------------------------------------------------------
//
// Copyright (C) Intel Corporation, 2007.
//
// File: Exception.h
//
// Contents: General Wsman Exception definition
//
//----------------------------------------------------------------------------
#ifndef __WSMAN_EXCEPTION_H
#define __WSMAN_EXCEPTION_H
#include <string>
#include <stdexcept>
using namespace std;
// Error Codes
#define WSMAN_SUCCESS 0
// A general error occurred
#define WSMAN_GENERAL_ERROR 1
// A transport level error occurred
#define WSMAN_TRANSPORT_ERROR 2
// An HTTP error occurred
#define WSMAN_HTTP_ERROR 3
// The WS-MAN server returned a soap fault
#define WSMAN_SOAP_FAULT 4
// A string to type or type to string error occurred
#define WSMAN_TYPE_CONVERSION_ERROR 5
// Failed to parse or write an XML string
#define WSMAN_XML_ERROR 6
// Input information is missing
#define WSMAN_MISSING_INPUT 7
// An unexpected response was received
#define WSMAN_RESPONSE_UNKNOWN 8
// Error resulting from MustUnderstand attribute
#define WSMAN_MUST_UNDERSTAND 9
// The soap message is invalid or of invalid version
#define WSMAN_SOAP_MESSAGE_INVALID 10
// The Soap header is too long
#define WSMAN_SOAP_HDR_OVERFLOW 11
// a UDP error occurred
#define WSMAN_UDP_ERROR 12
// a TCP error occurred
#define WSMAN_TCP_ERROR 13
// failed to connect to server
#define WSMAN_CONNECT_ERROR 14
// resource not found
#define WSMAN_RESOURCE_NOT_FOUND 15
namespace WsmanExceptionNamespace
{
class GeneralWsmanException : public exception
{
private:
string _what;
unsigned int error;
public:
GeneralWsmanException(const char* what,
unsigned int err = WSMAN_GENERAL_ERROR)
:_what(what), error(err){}
virtual ~GeneralWsmanException() throw (){}
virtual string getDetail()
{
return _what;
}
virtual const char *what() const throw()
{
return _what.c_str();
};
virtual unsigned int getErr() const throw()
{
return error;
}
string getStrErr()
{
string res = "Unknown error";
switch(error)
{
case WSMAN_SUCCESS:
res = "Operation succeeded";
break;
case WSMAN_GENERAL_ERROR:
res = "General error occurred";
break;
case WSMAN_TRANSPORT_ERROR:
res = "Transport error occurred";
break;
case WSMAN_HTTP_ERROR:
res = "HTTP error occurred";
break;
case WSMAN_SOAP_FAULT:
res = "SOAP error occurred";
break;
case WSMAN_TYPE_CONVERSION_ERROR:
res = "Conversion type error occurred";
break;
case WSMAN_XML_ERROR:
res = "XML error occurred";
break;
case WSMAN_MISSING_INPUT:
res = "Missing input error occurred";
break;
case WSMAN_RESPONSE_UNKNOWN:
res = "Response unknown";
break;
case WSMAN_MUST_UNDERSTAND:
res = "Must understand error";
break;
case WSMAN_SOAP_MESSAGE_INVALID:
res = "SOAP message invalid";
break;
case WSMAN_SOAP_HDR_OVERFLOW:
res = "Overflow soap header";
break;
case WSMAN_UDP_ERROR:
res = "UDP error occurred";
break;
case WSMAN_TCP_ERROR:
res = "TCP error occurred";
break;
case WSMAN_CONNECT_ERROR:
res = "Connection error occurred";
break;
}
return res;
}
};
}
#endif
|