1 #ifndef _KVI_ERROR_H_
2 #define _KVI_ERROR_H_
3 //=============================================================================
4 //
5 //   File : KviError.h
6 //   Creation date : Sun Jul 02 2000 18:35:56 by Szymon Stefanek
7 //
8 //   This file is part of the KVIrc IRC client distribution
9 //   Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 //   This program is FREE software. You can redistribute it and/or
12 //   modify it under the terms of the GNU General Public License
13 //   as published by the Free Software Foundation; either version 2
14 //   of the License, or (at your option) any later version.
15 //
16 //   This program is distributed in the HOPE that it will be USEFUL,
17 //   but WITHOUT ANY WARRANTY; without even the implied warranty of
18 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 //   See the GNU General Public License for more details.
20 //
21 //   You should have received a copy of the GNU General Public License
22 //   along with this program. If not, write to the Free Software Foundation,
23 //   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 /**
28 * \file KviError.h
29 * \author Szymon Stefanek
30 * \brief Error List
31 */
32 
33 #include "kvi_settings.h"
34 
35 class QString;
36 
37 /**
38 * \namespace KviError
39 * \brief This namespace handle the error codes
40 */
41 namespace KviError
42 {
43 	/**
44 	* \enum Code
45 	* \brief Contains all error codes
46 	*/
47 	enum Code
48 	{
49 		Success = 0,
50 		UnknownError = 1,
51 		InternalError = 2,
52 		UnknownCommand = 3,
53 		MissingClosingBrace = 4,
54 		UnexpectedEndInString = 5,
55 		UnexpectedEndInDictionaryKey = 6,
56 		SwitchDashWithoutSwitchLetter = 7,
57 		UnknownFunction = 8,
58 		UnexpectedEndInParenthesis = 9,
59 		UnexpectedEndInFunctionParams = 10,
60 		MissingVariableName = 11,
61 		VariableOrIdentifierExpected = 12,
62 		LeftOperandIsNotANumber = 13,
63 		MultipleOpsNotSupportedForOperator = 14,
64 		DivisionByZero = 15,
65 		ModuloByZero = 16,
66 		RightOperandIsNotANumber = 17,
67 		UnterminatedExpression = 18,
68 		UnterminatedSubexpression = 19,
69 		UnexpectedCharacter = 20,
70 		UnknownOperator = 21,
71 		NoHostToResolve = 22,
72 		UnsupportedAddressFamily = 23,
73 		ValidNameButNoIpAddress = 24,
74 		UnrecoverableNameserverError = 25,
75 		DNSTemporaneousFault = 26,
76 		DNSInternalErrorBadFlags = 27,
77 		DNSInternalErrorOutOfMemory = 28,
78 		DNSInternalErrorServiceNotSupported = 29,
79 		DNSNoName = 30,
80 		DNSInternalErrorUnsupportedSocketType = 31,
81 		DNSQueryFailed = 32,
82 		NoIPv6Support = 33,
83 		HostNotFound = 34,
84 		DNSInternalIPCFailure = 35,
85 		AnotherConnectionInProgress = 36,
86 		InvalidIpAddress = 37,
87 		SocketCreationFailed = 38,
88 		AsyncSocketFailed = 39,
89 		BadFileDescriptor = 40,
90 		OutOfAddressSpace = 41,
91 		ConnectionRefused = 42,
92 		KernelNetworkingPanic = 43,
93 		ConnectionTimedOut = 44,
94 		NetworkUnreachable = 45,
95 		BrokenPipe = 46,
96 		InvalidProxyAddress = 47,
97 		RemoteEndClosedConnection = 48,
98 		InvalidIrcContextId = 49,
99 		ErrorInLoadingModule = 50,
100 		NoSuchModuleCommand = 51,
101 		NoSuchModuleFunction = 52,
102 		LeftOperandIsNotADictionaryReference = 53,
103 		RightOperandIsNotADictionaryReference = 54,
104 		MissingObjectClassName = 55,
105 		NoSuchObjectClass = 56,
106 		NoSuchObject = 57,
107 		NoSuchObjectFunction = 58,
108 		InvalidLeftOperand = 59,
109 		NotEnoughParameters = 60,
110 		IntegerParameterExpected = 61,
111 		InvalidParameter = 62,
112 		NoSuchFile = 63,
113 		OpenParenthesisExpected = 64,
114 		OpenBraceExpected = 65,
115 		CantKillABuiltinClass = 66,
116 		SocksV4LacksIPv6Support = 67,
117 		UnrecognizedProxyReply = 68,
118 		ProxyAuthFailed = 69,
119 		ProxyNoAcceptableAuthMethod = 70,
120 		ProxyReply91RequestFailed = 71,
121 		ProxyReply92IdentFailed = 72,
122 		ProxyReply93IdentNotMatching = 73,
123 		ProxyReply01GeneralSOCKSFailure = 74,
124 		ProxyReply02ConnectionNotAllowed = 75,
125 		ProxyReply03NetworkUnreachable = 76,
126 		ProxyReply04HostUnreachable = 77,
127 		ProxyReply05ConnectionRefused = 78,
128 		ProxyReply06TTLExpired = 79,
129 		ProxyReply07CommandNotSupported = 80,
130 		ProxyReply08AddressTypeNotSupported = 81,
131 		ProxyReply09InvalidAddress = 82,
132 		InvalidPortNumber = 83,
133 		SocketNotConnected = 84,
134 		InsufficientResources = 85,
135 		BindFailed = 86,
136 		CantResolveLocalhost = 87,
137 		UnsupportedImageFormat = 88,
138 		CantOpenFileForAppending = 89,
139 		CantOpenFileForWriting = 90,
140 		FileIOError = 91,
141 		AcknowledgeError = 92,
142 		CantOpenFileForReading = 93,
143 		CantSendAZeroSizeFile = 94,
144 		MissingPopupName = 95,
145 		ItemPopupOrSeparatorExpected = 96,
146 		SelfModificationNotAllowed = 97,
147 		FeatureNotAvailable = 98,
148 		UnexpectedCharactersInArrayIndex = 99,
149 		UnexpectedEndInExpression = 100,
150 		UnexpectedEndInArrayIndex = 101,
151 		ProxyHttpFailure = 102,
152 		CaseMatchRegexpDefaultOrBreakExpected = 103,
153 		AccessDenied = 104,
154 		AddressAlreadyInUse = 105,
155 		CantAssignRequestedAddress = 106,
156 		ConnectionResetByPeer = 107,
157 		HostUnreachable = 108,
158 		VariableExpected = 109,
159 		InvalidArrayIndex = 110,
160 		ListenFailed = 111,
161 		NoSSLSupport = 112,
162 		SSLError = 113,
163 		SlashCharacterExpected = 114,
164 		UnknownStringManipulationOperator = 115,
165 		OperationAborted = 116,
166 		UnexpectedToken = 117,
167 		ScopeObjectAlreadyDefined = 118,
168 		NoThisObject = 119,
169 		ErrorCount = 120
170 	};
171 
172 	/**
173 	* \brief Returns the description of the error
174 	* \param eError The code number of the error
175 	* \return QString
176 	*/
177 	KVILIB_API QString getDescription(KviError::Code eError);
178 
179 	/**
180 	* \brief Returns an untranslated description of the error
181 	* \param eError The code number of the error
182 	* \return const char *
183 	*/
184 	KVILIB_API const char * getUntranslatedDescription(KviError::Code eError);
185 
186 	/**
187 	* \brief Gets system errors and returns their code number
188 	* \param iErrNo The code number of the system error
189 	* \return int
190 	*/
191 	KVILIB_API KviError::Code translateSystemError(int iErrNo);
192 }
193 
194 #endif //_KVI_ERROR_H_
195