Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
/me is stupid. Making a directory called core breaks the make clean because it tries...
[simgrid.git] / src / xbt / error.c
diff --git a/src/xbt/error.c b/src/xbt/error.c
new file mode 100644 (file)
index 0000000..6e5e1b8
--- /dev/null
@@ -0,0 +1,37 @@
+/* $Id$ */
+
+/* error - Error handling functions                                         */
+
+/* Authors: Martin Quinson                                                  */
+/* Copyright (C) 2001,2002,2003,2004 the OURAGAN project.                   */
+
+/* This program is free software; you can redistribute it and/or modify it
+   under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "gras_private.h"
+
+/**
+ * gras_error_name:
+ * @errcode: 
+ * @Returns: the printable name of an error code
+ *
+ * usefull to do nice error repporting messages
+ */
+
+const char *gras_error_name(gras_error_t errcode)  {
+
+   switch (errcode) {
+      
+    case no_error: return "success";
+    case malloc_error: return "malloc";
+    case mismatch_error: return "mismatch";
+    case system_error: return "system";
+    case network_error: return "network";
+    case timeout_error: return "timeout";
+    case thread_error: return "thread";
+    case unknown_error: return "unclassified";
+    default:
+      return "SEVERE ERROR in error repporting module";
+   }
+}
+