-#ifdef __cplusplus
-#include <stdexcept>
-#include <xbt/exception.hpp>
-#endif
-
-#include "xbt/base.h"
-#include "xbt/sysdep.h"
-#include "xbt/misc.h"
-#include "xbt/virtu.h"
-
-/*-*-* Emergency debuging: define this when the exceptions get crazy *-*-*/
-#undef __EX_MAYDAY
-#ifdef __EX_MAYDAY
-# include <stdio.h>
-#include <errno.h>
-# define MAYDAY_SAVE(m) printf("%d %s:%d save %p\n", \
- xbt_getpid(), __FILE__, __LINE__, \
- (m)->jb \
- ),
-# define MAYDAY_RESTORE(m) printf("%d %s:%d restore %p\n", \
- xbt_getpid(), __FILE__, __LINE__, \
- (m)->jb \
- ),
-# define MAYDAY_CATCH(e) printf("%d %s:%d Catched '%s'\n", \
- xbt_getpid(), __FILE__, __LINE__, \
- (e).msg \
- ),
-#else
-# define MAYDAY_SAVE(m)
-# define MAYDAY_RESTORE(m)
-# define MAYDAY_CATCH(e)
-#endif
-/*-*-* end of debugging stuff *-*-*/
-
-/** @brief different kind of errors */
-typedef enum {
- unknown_error = 0, /**< unknown error */
- arg_error, /**< Invalid argument */
- bound_error, /**< Out of bounds argument */
- mismatch_error, /**< The provided ID does not match */
- not_found_error, /**< The searched element was not found */
- system_error, /**< a syscall did fail */
- network_error, /**< error while sending/receiving data */
- timeout_error, /**< not quick enough, dude */
- cancel_error, /**< an action was canceled */
- thread_error, /**< error while [un]locking */
- host_error, /**< host failed */
- tracing_error, /**< error during the simulation tracing */
- io_error, /**< disk or file error */
- vm_error /**< vm error */
-} xbt_errcat_t;
-
-#ifdef __cplusplus
-XBT_PUBLIC_CLASS xbt_ex :
- public std::runtime_error,
- public simgrid::xbt::WithContextException {
-public:
- xbt_ex() : std::runtime_error("") {}
- xbt_ex(const char* message) : std::runtime_error(message) {}
- ~xbt_ex() override;
-
- xbt_errcat_t category; /**< category like HTTP (what went wrong) */
- int value; /**< like errno (why did it went wrong) */
- const char *file; /**< Thrown point */
- int line; /**< Thrown point */
- const char *func; /**< Thrown point */
-};
-#endif
-
-SG_BEGIN_DECL()
-
-XBT_PUBLIC(const char *) xbt_ex_catname(xbt_errcat_t cat);