Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
bab34d81184e6d60b1d670a7a8f9c867bc0373c8
[simgrid.git] / include / simgrid / exception.hpp
1 /* Copyright (c) 2018. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SIMGRID_EXCEPTIONS_HPP
7 #define SIMGRID_EXCEPTIONS_HPP
8
9 /** @file exception.hpp SimGrid-specific Exceptions
10  *
11  *  Defines all possible exception that could occur in a SimGrid library.
12  */
13
14 #include <exception>
15
16 namespace simgrid {
17
18 /** Ancestor class of all SimGrid exception */
19 class exception : public std::runtime_error {
20 public:
21   exception() : std::runtime_error("") {}
22   exception(const char* message) : std::runtime_error(message) {}
23 };
24
25 /** Exception raised when a timeout elapsed */
26 class timeout_error : public simgrid::exception {
27 };
28
29 /** Exception raised when an host fails */
30 class host_failure : public simgrid::exception {
31 };
32
33 /** Exception raised when a communication fails because of the network */
34 class network_failure : public simgrid::exception {
35 };
36
37 /** Exception raised when something got canceled before completion */
38 class cancel_error : public simgrid::exception {
39 };
40
41 } // namespace simgrid
42
43 #endif