From: Daniel KouĊ™il Date: Thu, 2 Jun 2011 13:37:34 +0000 (+0000) Subject: Added descriptive error messages X-Git-Tag: glite-px-proxyrenewal_R_1_3_21_1~13 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=bc1e1dc1323dcc3e6eec4cb97bc1d828c9d93546;p=jra1mw.git Added descriptive error messages --- diff --git a/org.glite.px.proxyrenewal/src/common.c b/org.glite.px.proxyrenewal/src/common.c index 70daeb0..4121a10 100644 --- a/org.glite.px.proxyrenewal/src/common.c +++ b/org.glite.px.proxyrenewal/src/common.c @@ -20,6 +20,21 @@ #ident "$Header$" +static const char * const ErrorMsgs[] = { + "Connection closed unexpectedly", + "Generic error", + "Cannot parse protocol messages", + "Obligatory item not found in message", + "Unkown command", + "SSL error", + "MyProxy error", + "Proxy not registered", + "Proxy expired", + "VOMS error", + "Operation timed out", + "System error", +}; + /* nread() and nwrite() never return partial data */ static int nread(int sock, struct timeval *to, char *buf, size_t buf_len, size_t *read_len) @@ -306,7 +321,11 @@ edg_wlpr_CleanResponse(edg_wlpr_Response *response) const char * edg_wlpr_GetErrorString(int code) { - return (code == 0) ? "OK" : "Error"; + if (code == 0) + return "No error"; + if (code <= EDG_WLPR_ERROR_BASE) + return strerror(code); + return ErrorMsgs[code - EDG_WLPR_ERROR_BASE - 1]; } char *