diff options
Diffstat (limited to 'cpp/lib/common/sys/apr/APRBase.h')
-rw-r--r-- | cpp/lib/common/sys/apr/APRBase.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cpp/lib/common/sys/apr/APRBase.h b/cpp/lib/common/sys/apr/APRBase.h index 9beba9fbad..6a866a554a 100644 --- a/cpp/lib/common/sys/apr/APRBase.h +++ b/cpp/lib/common/sys/apr/APRBase.h @@ -24,6 +24,7 @@ #include <string> #include <apr_thread_mutex.h> #include <apr_errno.h> +#include <QpidError.h> namespace qpid { namespace sys { @@ -60,6 +61,17 @@ namespace sys { } } +// Inlined as it is called *a lot* +void inline qpid::sys::check(apr_status_t status, const char* file, const int line){ + if (status != APR_SUCCESS){ + const int size = 50; + char tmp[size]; + std::string msg(apr_strerror(status, tmp, size)); + throw qpid::QpidError(APR_ERROR + ((int) status), msg, + qpid::SrcLine(file, line)); + } +} + |