X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ac6456bcb4a2a713c60fa36ce616d7a9687917c9..092910cd23c789eb83b53efb69e85ae58ed3b1d0:/src/xbt/error.c diff --git a/src/xbt/error.c b/src/xbt/error.c new file mode 100644 index 0000000000..6e5e1b846b --- /dev/null +++ b/src/xbt/error.c @@ -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"; + } +} +