Commit 25440255 authored by Geoff Simmons's avatar Geoff Simmons

Return safely allocated error messages from AMQ_Connection.

This leaks memory; apparently it has been an unsafe practice all
along. But support for ActiveMQ will be discontinued anyway.
parent e738e0d0
...@@ -32,18 +32,19 @@ ...@@ -32,18 +32,19 @@
#include "amq_connection.h" #include "amq_connection.h"
#include <decaf/lang/exceptions/NullPointerException.h> #include <decaf/lang/exceptions/NullPointerException.h>
#define CATCHALL \ #define CATCHALL \
catch (CMSException& cex) { \ catch (CMSException& cex) { \
return cex.what(); \ string *msg = new string(cex.getMessage()); \
} \ return msg->c_str(); \
catch (Throwable& th) { \ } \
return th.what(); \ catch (Throwable& th) { \
} \ return th.what(); \
catch (std::exception& sex) { \ } \
return sex.what(); \ catch (std::exception& sex) { \
} \ return sex.what(); \
catch (...) { \ } \
return "Unexpected error"; \ catch (...) { \
return "Unexpected error"; \
} }
using namespace std; using namespace std;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment