projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
No-op: remove all trailing whitespace.
[dcpomatic.git]
/
src
/
lib
/
exceptions.h
diff --git
a/src/lib/exceptions.h
b/src/lib/exceptions.h
index 52f257a8d3f558550ccba9724dfe612e3eca55c0..268e8c36d200771d84e291ccd90e8f215da54c29 100644
(file)
--- a/
src/lib/exceptions.h
+++ b/
src/lib/exceptions.h
@@
-24,14
+24,14
@@
#ifndef DCPOMATIC_EXCEPTIONS_H
#define DCPOMATIC_EXCEPTIONS_H
#ifndef DCPOMATIC_EXCEPTIONS_H
#define DCPOMATIC_EXCEPTIONS_H
-#include <stdexcept>
-#include <cstring>
-#include <boost/exception/all.hpp>
-#include <boost/filesystem.hpp>
#include <boost/thread.hpp>
extern "C" {
#include <libavutil/pixfmt.h>
}
#include <boost/thread.hpp>
extern "C" {
#include <libavutil/pixfmt.h>
}
+#include <boost/exception/all.hpp>
+#include <boost/filesystem.hpp>
+#include <stdexcept>
+#include <cstring>
/** @class StringError
* @brief A parent class for exceptions using messages held in a std::string
/** @class StringError
* @brief A parent class for exceptions using messages held in a std::string
@@
-40,9
+40,9
@@
class StringError : public std::exception
{
public:
/** @param w Error message */
{
public:
/** @param w Error message */
- StringError (std::string w)
{
- _what = w;
- }
+ StringError (std::string w)
+ : _what (w)
+
{
}
virtual ~StringError () throw () {}
virtual ~StringError () throw () {}
@@
-259,6
+259,12
@@
public:
InvalidSignerError ();
};
InvalidSignerError ();
};
+class ProgrammingError : public StringError
+{
+public:
+ ProgrammingError (std::string file, int line);
+};
+
/** @class ExceptionStore
* @brief A parent class for classes which have a need to catch and
* re-throw exceptions.
/** @class ExceptionStore
* @brief A parent class for classes which have a need to catch and
* re-throw exceptions.
@@
-284,13
+290,14
@@
public:
void rethrow () {
boost::mutex::scoped_lock lm (_mutex);
if (_exception) {
void rethrow () {
boost::mutex::scoped_lock lm (_mutex);
if (_exception) {
- boost::
rethrow_exception (_exception)
;
+ boost::
exception_ptr tmp = _exception
;
_exception = boost::exception_ptr ();
_exception = boost::exception_ptr ();
+ boost::rethrow_exception (tmp);
}
}
}
}
-protected:
-
+protected:
+
void store_current () {
boost::mutex::scoped_lock lm (_mutex);
_exception = boost::current_exception ();
void store_current () {
boost::mutex::scoped_lock lm (_mutex);
_exception = boost::current_exception ();