Cleanup: whitespace.
[dcpomatic.git] / src / lib / exceptions.h
index 5cbf6994154dadaeda169130cd82ac2ddaf48637..80d4801daf83d24854d2b6f1e23a11b6497eab9a 100644 (file)
@@ -253,9 +253,19 @@ public:
 class NetworkError : public std::runtime_error
 {
 public:
-       explicit NetworkError (std::string s)
-               : std::runtime_error (s)
-       {}
+       explicit NetworkError (std::string s, boost::optional<std::string> d = boost::optional<std::string>());
+
+       std::string summary () const {
+               return _summary;
+       }
+
+       boost::optional<std::string> detail () const {
+               return _detail;
+       }
+
+private:
+       std::string _summary;
+       boost::optional<std::string> _detail;
 };
 
 
@@ -325,6 +335,15 @@ public:
 };
 
 
+class CPLNotFoundError : public DCPError
+{
+public:
+       CPLNotFoundError(std::string id)
+               : DCPError(String::compose("CPL %1 not found", id))
+       {}
+};
+
+
 class InvalidSignerError : public std::runtime_error
 {
 public:
@@ -332,8 +351,8 @@ public:
        explicit InvalidSignerError (std::string reason);
 };
 
-class ProgrammingError : public std::runtime_error
 
+class ProgrammingError : public std::runtime_error
 {
 public:
        ProgrammingError (std::string file, int line, std::string message = "");
@@ -377,7 +396,8 @@ public:
 class GLError : public std::runtime_error
 {
 public:
-       GLError (char const * last, int e);
+       GLError (char const* last, int e);
+       GLError (char const* message);
 };
 
 
@@ -387,25 +407,30 @@ public:
 class CopyError : public std::runtime_error
 {
 public:
-       CopyError (std::string s, boost::optional<int> n = boost::optional<int>());
+       CopyError (std::string s, boost::optional<int> ext4_error = boost::optional<int>(), boost::optional<int> platform_error = boost::optional<int>());
        virtual ~CopyError () throw () {}
 
        std::string message () const {
                return _message;
        }
 
-       boost::optional<int> number () const {
-               return _number;
+       boost::optional<int> ext4_number() const {
+               return _ext4_number;
+       }
+
+       boost::optional<int> platform_number() const {
+               return _platform_number;
        }
 
 private:
        std::string _message;
-       boost::optional<int> _number;
+       boost::optional<int> _ext4_number;
+       boost::optional<int> _platform_number;
 };
 
 
 /** @class CommunicationFailedError
- *  @brief Communcation between dcpomatic2_disk and _disk_writer failed somehow.
+ *  @brief Communication between dcpomatic2_disk and _disk_writer failed somehow.
  */
 class CommunicationFailedError : public CopyError
 {
@@ -441,8 +466,8 @@ class PrivilegeError : public std::runtime_error
 {
 public:
        explicit PrivilegeError (std::string s)
-                       : std::runtime_error (s)
-               {}
+               : std::runtime_error (s)
+       {}
 };