3 /* error - Error handling functions */
5 /* Authors: Martin Quinson */
6 /* Copyright (C) 2001,2002,2003,2004 the OURAGAN project. */
8 /* This program is free software; you can redistribute it and/or modify it
9 under the terms of the license (GNU LGPL) which comes with this package. */
11 #include "xbt/error.h"
12 #include "xbt/sysdep.h"
15 * \brief Usefull to do nice error repporting messages.
18 * \return the printable name of an error code
21 const char *xbt_error_name(xbt_error_t errcode) {
25 case no_error: return "success";
26 case mismatch_error: return "mismatch";
27 case system_error: return "system";
28 case network_error: return "network";
29 case timeout_error: return "timeout";
30 case thread_error: return "thread";
31 case unknown_error: return "unclassified";
33 return "SEVERE ERROR in error repporting module";
37 XBT_LOG_EXTERNAL_CATEGORY(xbt);
38 XBT_LOG_DEFAULT_CATEGORY(xbt);
41 * @brief Kill the program with an error message
44 * Things are so messed up that the only thing to do now, is to stop the program.
46 * The message is handled by a CRITICAL logging request
48 * If you want to pass arguments to the format, you can always write xbt_assert1(0,"fmt",args)
50 void xbt_die (const char *msg) {
55 /** @brief Kill the program in silence */
56 void xbt_abort(void) {