Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add the possibility to remove an item in the middle of the list.
[simgrid.git] / src / xbt / error.c
1 /* $Id$ */
2
3 /* error - Error handling functions                                         */
4
5 /* Authors: Martin Quinson                                                  */
6 /* Copyright (C) 2001,2002,2003,2004 the OURAGAN project.                   */
7
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. */
10
11 #include "xbt/error.h"
12
13 /**
14  * xbt_error_name:
15  * @errcode: 
16  * @Returns: the printable name of an error code
17  *
18  * usefull to do nice error repporting messages
19  */
20
21 const char *xbt_error_name(xbt_error_t errcode)  {
22
23    switch (errcode) {
24       
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";
32     default:
33       return "SEVERE ERROR in error repporting module";
34    }
35 }
36
37 XBT_LOG_EXTERNAL_CATEGORY(gras);
38 XBT_LOG_DEFAULT_CATEGORY(gras);
39   
40 void xbt_die (const char *msg) {
41    CRITICAL1("%s",msg);
42    xbt_abort();
43 }
44