diff options
author | Alan Conway <aconway@apache.org> | 2007-06-13 18:46:29 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-06-13 18:46:29 +0000 |
commit | 3eba3dccb56a799f9754bf9a2e1196c80a40bc72 (patch) | |
tree | 3b8488a0b7e9ec66ff752b75ac7354925e92e52e /qpid/cpp | |
parent | c48c2e1532a0a145d9f0875abd232398e1b3f873 (diff) | |
download | qpid-python-3eba3dccb56a799f9754bf9a2e1196c80a40bc72.tar.gz |
Examples update, exception handling.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@546995 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r-- | qpid/cpp/examples/create_queue.cpp | 2 | ||||
-rw-r--r-- | qpid/cpp/examples/topic_listener.cpp | 4 | ||||
-rw-r--r-- | qpid/cpp/examples/topic_publisher.cpp | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/qpid/cpp/examples/create_queue.cpp b/qpid/cpp/examples/create_queue.cpp index e30f40c1f6..7d08873246 100644 --- a/qpid/cpp/examples/create_queue.cpp +++ b/qpid/cpp/examples/create_queue.cpp @@ -73,7 +73,7 @@ int main() { channel.close(); connection.close(); return 0; - } catch(qpid::QpidError error) { + } catch(const std::exception& error) { std::cout << error.what() << std::endl; } return 1; diff --git a/qpid/cpp/examples/topic_listener.cpp b/qpid/cpp/examples/topic_listener.cpp index 3ad32a46cc..a5de89a736 100644 --- a/qpid/cpp/examples/topic_listener.cpp +++ b/qpid/cpp/examples/topic_listener.cpp @@ -65,6 +65,7 @@ int main() { Connection connection; Channel channel; Message msg; + cout << "Hello" << endl; try { connection.open("127.0.0.1", 5672, "guest", "guest", "/test"); connection.openChannel(channel); @@ -85,9 +86,10 @@ int main() { channel.close(); connection.close(); return 0; - } catch(std::exception error) { + } catch(const std::exception& error) { cout << "Unexpected exception: " << error.what() << endl; } + connection.close(); return 1; } diff --git a/qpid/cpp/examples/topic_publisher.cpp b/qpid/cpp/examples/topic_publisher.cpp index ecf5d51f2b..d3e1ea20b3 100644 --- a/qpid/cpp/examples/topic_publisher.cpp +++ b/qpid/cpp/examples/topic_publisher.cpp @@ -73,7 +73,7 @@ int main() { channel.close(); connection.close(); return 0; - } catch(qpid::QpidError error) { + } catch(const std::exception& error) { std::cout << error.what() << std::endl; } return 1; |