+namespace simgrid {
+
+/** Exception raised when a timeout elapsed */
+class TimeoutError : public xbt_ex {
+public:
+ TimeoutError(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+ : xbt_ex(std::move(throwpoint), std::move(message))
+ {
+ category = timeout_error;
+ }
+};
+
+/** Exception raised when a host fails */
+class HostFailureException : public xbt_ex {
+public:
+ HostFailureException(simgrid::xbt::ThrowPoint throwpoint, std::string message)
+ : xbt_ex(std::move(throwpoint), std::move(message))
+ {
+ category = host_error;
+ }
+};
+
+/** 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)
+ : xbt_ex(std::move(throwpoint), std::move(message))
+ {
+ category = network_error;
+ }
+};
+
+/** 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
+