From 114cb732d1c7410952045f214292f69110823c61 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 29 Jun 2005 06:14:35 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=6493 --- checkin_notes | 13 +++++++++++++ client/net_xfer.C | 2 +- client/scheduler_op.C | 8 ++++---- lib/error_numbers.h | 1 + lib/util.C | 5 ++++- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/checkin_notes b/checkin_notes index 0ec5092c8f..5c52d371fc 100755 --- a/checkin_notes +++ b/checkin_notes @@ -8755,3 +8755,16 @@ Rom 28 June 2005 clientgui/ MainFrame.cpp + +David 28 June 2005 + - add ERR_NO_NETWORK_CONNECTION error code. + Return this if can't connect to server because no network connection. + - show boincerror(retval) instead of retval in a couple of messages. + Should do this everywhere. + + client/ + net_xfer.C + scheduler_op.C + lib/ + error_numbers.h + util.C diff --git a/client/net_xfer.C b/client/net_xfer.C index ea7df568bb..59b8b1092a 100644 --- a/client/net_xfer.C +++ b/client/net_xfer.C @@ -97,7 +97,7 @@ int NET_XFER::open_server() { #ifdef _WIN32 if (get_connected_state() == CONNECTED_STATE_NOT_CONNECTED) { gstate.want_network_flag = true; - return ERR_CONNECT; + return ERR_NO_NETWORK_CONNECTION; } else { gstate.want_network_flag = false; } diff --git a/client/scheduler_op.C b/client/scheduler_op.C index 16a403a128..11352a4b84 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -140,8 +140,8 @@ int SCHEDULER_OP::init_op_project(PROJECT* p) { } if (retval) { sprintf(err_msg, - "Scheduler request initialization to %s failed, error %d\n", - p->get_scheduler_url(url_index, url_random), retval + "Scheduler request to %s failed: %s\n", + p->get_scheduler_url(url_index, url_random), boincerror(retval) ); backoff(p, err_msg); } @@ -248,14 +248,14 @@ int SCHEDULER_OP::start_rpc(PROJECT* p) { retval = http_op.init_post(scheduler_url, request_file, reply_file); if (retval) { msg_printf(p, MSG_ERROR, - "Scheduler request failed init_post(): %d", retval + "Scheduler request failed: %s", boincerror(retval) ); return retval; } retval = http_ops->insert(&http_op); if (retval) { msg_printf(p, MSG_ERROR, - "Scheduler request failed HTTP insert: %d", retval + "Scheduler request failed: %s", boincerror(retval) ); return retval; } diff --git a/lib/error_numbers.h b/lib/error_numbers.h index 3221ea19dd..7acd8aeff0 100755 --- a/lib/error_numbers.h +++ b/lib/error_numbers.h @@ -150,6 +150,7 @@ #define ERR_USER_PERMISSION -201 // e.g. user didn't allow network connection #define ERR_SHMEM_NAME -202 +#define ERR_NO_NETWORK_CONNECTION -203 // PLEASE: add a text description of your error to // the text description function boincerror() in util.C. diff --git a/lib/util.C b/lib/util.C index 739bb6ba60..e627a8e440 100755 --- a/lib/util.C +++ b/lib/util.C @@ -931,8 +931,11 @@ const char* boincerror(int which_error) { case ERR_WRONG_SIZE: return "wrong size"; case ERR_USER_PERMISSION: return "user permission"; case ERR_SHMEM_NAME: return "can't get shared mem segment name"; + case ERR_NO_NETWORK_CONNECTION: return "no available network connection"; } - return "UNRECOGNIZED: make lib/util.C consistent with lib/error_numbers.h"; + static char buf[64]; + sprintf(buf, "error %d", which_error); + return buf; }