Apache Log4cxx  Version 1.8.0
Loading...
Searching...
No Matches
exception.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef _LOG4CXX_HELPERS_EXCEPTION_H
19#define _LOG4CXX_HELPERS_EXCEPTION_H
20
21#include <exception>
22#include <log4cxx/log4cxx.h>
23#include <log4cxx/logstring.h>
24#include <string>
25
26#ifdef _MSC_VER
27 #pragma warning ( push )
28 #pragma warning (disable : 4275) // ::std::exception needs to have dll-interface
29 #pragma warning (disable : 4251) // ::std::basic_string needs to have dll-interface
30#endif
31
32namespace LOG4CXX_NS
33{
34namespace helpers
35{
39class LOG4CXX_EXPORT Exception : public ::std::exception
40{
41 public:
42 Exception(const char* msg);
43 Exception(const LogString& msg);
44 Exception(const Exception& src);
46 const char* what() const throw();
47 static LogString makeMessage(const LogString& type, log4cxx_status_t stat);
48#if !LOG4CXX_LOGCHAR_IS_UTF8
49 static std::string makeMessage(const char* type, log4cxx_status_t stat);
50#endif
51 private:
52 std::string msg;
53}; // class Exception
54
58class LOG4CXX_EXPORT RuntimeException : public Exception
59{
60 public:
61 RuntimeException(log4cxx_status_t stat);
65 private:
66 static LogString formatMessage(log4cxx_status_t stat);
67}; // class RuntimeException
68
72class LOG4CXX_EXPORT NullPointerException : public RuntimeException
73{
74 public:
78}; // class NullPointerException
79
89
94class LOG4CXX_EXPORT IOException : public Exception
95{
96 public:
98 IOException(log4cxx_status_t stat);
100 IOException(const char* msg);
101 IOException(const LogString& type, log4cxx_status_t stat);
102#if !LOG4CXX_LOGCHAR_IS_UTF8
103 IOException(const char* msg, log4cxx_status_t stat);
104#endif
107 private:
108 static LogString formatMessage(log4cxx_status_t stat);
109};
110
111class LOG4CXX_EXPORT SubProcessFailure : public Exception
112{
113 public:
114 SubProcessFailure(const LogString& processName, int exitCode, int exitWhy);
115#if !LOG4CXX_LOGCHAR_IS_UTF8
116 SubProcessFailure(const char* processName, int exitCode, int exitWhy);
117#endif
120
121 static LogString makeMessage(const LogString& processName, int exitCode, int exitWhy);
122};
123
124class LOG4CXX_EXPORT MissingResourceException : public Exception
125{
126 public:
130 private:
131 static LogString formatMessage(const LogString& key);
132};
133
134class LOG4CXX_EXPORT PoolException : public Exception
135{
136 public:
137 PoolException(log4cxx_status_t stat);
140 private:
141 static LogString formatMessage(log4cxx_status_t stat);
142};
143
144
145class LOG4CXX_EXPORT InterruptedException : public Exception
146{
147 public:
149 InterruptedException(log4cxx_status_t stat);
152 private:
153 static LogString formatMessage(log4cxx_status_t stat);
154};
155
156class LOG4CXX_EXPORT ThreadException
157 : public Exception
158{
159 public:
160 ThreadException(log4cxx_status_t stat);
164 private:
165 static LogString formatMessage(log4cxx_status_t stat);
166};
167
168class LOG4CXX_EXPORT TranscoderException : public Exception
169{
170 public:
171 TranscoderException(log4cxx_status_t stat);
174 private:
175 static LogString formatMessage(log4cxx_status_t stat);
176};
177
186
199
205class LOG4CXX_EXPORT ClassNotFoundException : public Exception
206{
207 public:
211 private:
212 static LogString formatMessage(const LogString& className);
213};
214
215
223
231
235class LOG4CXX_EXPORT SocketException : public IOException
236{
237 public:
239 SocketException(log4cxx_status_t status);
242};
243
248class LOG4CXX_EXPORT ConnectException : public SocketException
249{
250 public:
252 ConnectException(log4cxx_status_t status);
255};
256
264
269class LOG4CXX_EXPORT BindException : public SocketException
270{
271 public:
272 BindException(log4cxx_status_t status);
275};
276
290
291
305
306
307} // namespace helpers
308} // namespace log4cxx
309
310#if defined(_MSC_VER)
311 #pragma warning (pop)
312#endif
313
314#endif // _LOG4CXX_HELPERS_EXCEPTION_H
BindException(const BindException &)
BindException & operator=(const BindException &)
BindException(log4cxx_status_t status)
ClassNotFoundException(const LogString &className)
ClassNotFoundException(const ClassNotFoundException &msg)
ClassNotFoundException & operator=(const ClassNotFoundException &msg)
ClosedChannelException(const ClosedChannelException &src)
ClosedChannelException & operator=(const ClosedChannelException &)
ConnectException & operator=(const ConnectException &)
ConnectException(const LogString &msg)
ConnectException(const ConnectException &src)
ConnectException(log4cxx_status_t status)
Exception(const LogString &msg)
static LogString makeMessage(const LogString &type, log4cxx_status_t stat)
const char * what() const
static std::string makeMessage(const char *type, log4cxx_status_t stat)
Exception & operator=(const Exception &src)
Exception(const char *msg)
Exception(const Exception &src)
IOException(const char *msg)
IOException(log4cxx_status_t stat)
IOException(const char *msg, log4cxx_status_t stat)
IOException(const LogString &type, log4cxx_status_t stat)
IOException(const LogString &msg)
IOException(const IOException &src)
IOException & operator=(const IOException &)
IllegalArgumentException(const LogString &msg)
IllegalArgumentException & operator=(const IllegalArgumentException &)
IllegalArgumentException(const IllegalArgumentException &)
IllegalMonitorStateException(const IllegalMonitorStateException &msg)
IllegalMonitorStateException & operator=(const IllegalMonitorStateException &msg)
IllegalStateException & operator=(const IllegalStateException &)
IllegalStateException(const IllegalStateException &)
InstantiationException & operator=(const InstantiationException &msg)
InstantiationException(const InstantiationException &msg)
InstantiationException(const LogString &msg)
InterruptedException(const InterruptedException &src)
InterruptedException & operator=(const InterruptedException &)
InterruptedException(log4cxx_status_t stat)
InterruptedIOException(const InterruptedIOException &)
InterruptedIOException(const LogString &msg)
InterruptedIOException & operator=(const InterruptedIOException &)
MissingResourceException(const LogString &key)
MissingResourceException & operator=(const MissingResourceException &)
MissingResourceException(const MissingResourceException &src)
NoSuchElementException(const NoSuchElementException &)
NoSuchElementException & operator=(const NoSuchElementException &)
NullPointerException(const LogString &msg)
NullPointerException(const NullPointerException &msg)
NullPointerException & operator=(const NullPointerException &src)
PoolException & operator=(const PoolException &)
PoolException(const PoolException &src)
PoolException(log4cxx_status_t stat)
RuntimeException & operator=(const RuntimeException &src)
RuntimeException(const RuntimeException &msg)
RuntimeException(log4cxx_status_t stat)
RuntimeException(const LogString &msg)
SocketException(const SocketException &)
SocketException(log4cxx_status_t status)
SocketException & operator=(const SocketException &)
SocketException(const LogString &msg)
SocketTimeoutException(const SocketTimeoutException &)
SocketTimeoutException & operator=(const SocketTimeoutException &)
SubProcessFailure & operator=(const SubProcessFailure &)
static LogString makeMessage(const LogString &processName, int exitCode, int exitWhy)
SubProcessFailure(const LogString &processName, int exitCode, int exitWhy)
SubProcessFailure(const char *processName, int exitCode, int exitWhy)
SubProcessFailure(const SubProcessFailure &src)
ThreadException(log4cxx_status_t stat)
ThreadException & operator=(const ThreadException &)
ThreadException(const LogString &msg)
ThreadException(const ThreadException &src)
TranscoderException(const TranscoderException &src)
TranscoderException(log4cxx_status_t stat)
TranscoderException & operator=(const TranscoderException &)
std::basic_string< logchar > LogString
Definition logstring.h:60