Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Enforce "Rule-of-Three/Five".
[simgrid.git] / include / simgrid / Exception.hpp
index db16dd9..6de2686 100644 (file)
@@ -53,8 +53,7 @@ public:
 
 /** Create a ThrowPoint with (__FILE__, __LINE__, __func__) */
 #define XBT_THROW_POINT                                                                                                \
-  ::simgrid::xbt::ThrowPoint(__FILE__, __LINE__, __func__, std::move(simgrid::xbt::Backtrace()), xbt_procname(),       \
-                             xbt_getpid())
+  ::simgrid::xbt::ThrowPoint(__FILE__, __LINE__, __func__, simgrid::xbt::Backtrace(), xbt_procname(), xbt_getpid())
 } // namespace xbt
 
 /** Ancestor class of all SimGrid exception */
@@ -134,7 +133,7 @@ public:
   }
 };
 
-/** Exception raised when a communication fails because of the network */
+/** Exception raised when a communication fails because of the network or because of the remote host */
 class NetworkFailureException : public xbt_ex {
 public:
   NetworkFailureException(simgrid::xbt::ThrowPoint throwpoint, std::string message)
@@ -144,8 +143,24 @@ public:
   }
 };
 
+/** Exception raised when a storage fails */
+class StorageFailureException : public xbt_ex {
+public:
+  StorageFailureException(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+      : xbt_ex(std::move(throwpoint), std::move(message))
+  {
+    category = io_error;
+  }
+};
+
 /** Exception raised when something got canceled before completion */
 class CancelException : public xbt_ex {
+public:
+  CancelException(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+      : xbt_ex(std::move(throwpoint), std::move(message))
+  {
+    category = cancel_error;
+  }
 };
 
 } // namespace simgrid