Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow the unit tests to setup the logs
[simgrid.git] / include / xbt / ex.hpp
index c1dcfb8..cde2d3e 100644 (file)
 
 #include <xbt/ex.h>
 
-/** (Deprecated) Generic exception
+/** A legacy exception
  *
- *  An error is defined by a category and a value within that category.
+ *  It is defined by a category and a value within that category (as well as
+ *  an optional error message).
  *
  *  This used to be a structure for C exceptions but it has been retrofitted
  *  as a C++ exception and some of its data has been moved in the
- *  WithContextException base class. We should deprecate it and replace it
+ *  @ref WithContextException base class. We should deprecate it and replace it
  *  with either C++ different exceptions or `std::system_error` which already
  *  provides this (category + error code) logic.
+ *
+ *  @ingroup XBT_ex_c
  */
 struct XBT_PUBLIC() xbt_ex :
   public std::runtime_error,
@@ -80,10 +83,10 @@ public:
   ~xbt_ex() override;
 
   /** Category (what went wrong) */
-  xbt_errcat_t category;
+  xbt_errcat_t category = unknown_error;
 
   /** Why did it went wrong */
-  int value;
+  int value = 0;
 
 };