Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET
Apache Qpid Documentation
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
qpid
Exception.h
Go to the documentation of this file.
1
#ifndef _Exception_
2
#define _Exception_
3
4
/*
5
*
6
* Licensed to the Apache Software Foundation (ASF) under one
7
* or more contributor license agreements. See the NOTICE file
8
* distributed with this work for additional information
9
* regarding copyright ownership. The ASF licenses this file
10
* to you under the Apache License, Version 2.0 (the
11
* "License"); you may not use this file except in compliance
12
* with the License. You may obtain a copy of the License at
13
*
14
* http://www.apache.org/licenses/LICENSE-2.0
15
*
16
* Unless required by applicable law or agreed to in writing,
17
* software distributed under the License is distributed on an
18
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19
* KIND, either express or implied. See the License for the
20
* specific language governing permissions and limitations
21
* under the License.
22
*
23
*/
24
25
#include "
qpid/framing/amqp_types.h
"
26
#include "
qpid/framing/constants.h
"
27
#include "
qpid/framing/enum.h
"
28
#include "
qpid/sys/StrError.h
"
29
#include "
qpid/CommonImportExport.h
"
30
#include <string>
31
#include <errno.h>
32
33
namespace
qpid
34
{
35
39
class
QPID_COMMON_CLASS_EXTERN
Exception
:
public
std::exception
40
{
41
public
:
42
QPID_COMMON_EXTERN
explicit
Exception
(
const
std::string& message=std::string())
throw
();
43
QPID_COMMON_EXTERN
virtual
~
Exception
()
throw
();
44
QPID_COMMON_EXTERN
virtual
const
char
* what()
const
throw
();
// prefix: message
45
QPID_COMMON_EXTERN
virtual
std::string getMessage()
const
;
// Unprefixed message
46
QPID_COMMON_EXTERN
virtual
std::string getPrefix()
const
;
// Prefix
47
48
private
:
49
std::string message;
50
mutable
std::string whatStr;
51
};
52
54
struct
QPID_COMMON_CLASS_EXTERN
ErrnoException
:
public
Exception
{
55
ErrnoException
(
const
std::string& msg,
int
err) :
Exception
(msg+
": "
+qpid::sys::
strError
(err)) {}
56
ErrnoException
(
const
std::string& msg) :
Exception
(msg+
": "
+qpid::sys::
strError
(errno)) {}
57
};
58
59
struct
QPID_COMMON_CLASS_EXTERN
SessionException
:
public
Exception
{
60
const
framing::execution::ErrorCode
code
;
61
SessionException
(
framing::execution::ErrorCode
code_,
const
std::string& message)
62
:
Exception
(message), code(code_) {}
63
};
64
65
struct
QPID_COMMON_CLASS_EXTERN
ChannelException
:
public
Exception
{
66
const
framing::session::DetachCode
code
;
67
ChannelException
(
framing::session::DetachCode
_code,
const
std::string& message)
68
:
Exception
(message), code(_code) {}
69
};
70
71
struct
QPID_COMMON_CLASS_EXTERN
ConnectionException
:
public
Exception
{
72
const
framing::connection::CloseCode
code
;
73
ConnectionException
(
framing::connection::CloseCode
_code,
const
std::string& message)
74
:
Exception
(message), code(_code) {}
75
};
76
77
struct
QPID_COMMON_CLASS_EXTERN
ClosedException
:
public
Exception
{
78
QPID_COMMON_EXTERN
ClosedException
(
const
std::string& msg=std::string());
79
QPID_COMMON_EXTERN
std::string getPrefix()
const
;
80
};
81
85
struct
TransportFailure
:
public
Exception
{
86
TransportFailure
(
const
std::string& msg=std::string()) :
Exception
(msg) {}
87
};
88
89
}
// namespace qpid
90
91
#endif
Qpid C++ API Reference
Generated on Thu Jun 13 2013 for Qpid C++ Client API by
1.8.1.1