Changeset 16 in cheroxy for trunk/src/main.cpp


Ignore:
Timestamp:
10/24/12 11:48:13 (12 years ago)
Author:
cheese
Message:

#1 modify error message to detail

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main.cpp

    r15 r16  
    127127    CRXHttpRequest      aHttpRequest;
    128128    CRXHttpResponse     aHttpResponse;
    129     string              aUrl    = "";
    130     string              aHost   = "";
    131     int                 aPort   = 0;
    132129
    133130    CRXSocket           aWebServer;
     
    145142        {
    146143            CRX_PRINT_ERROR (aReceivedSize, "failed to receive from client (" << CRX_ERROR () << ")");
    147             return aResult;
     144            return aReceivedSize;
    148145        }
    149146
     
    158155            if (aResult < 0)
    159156            {
    160                 CRX_PRINT_ERROR (aResult, "failed to connect to server <" << aHost << ":" << aPort << "> (" << CRX_ERROR () << ")");
     157                CRX_PRINT_ERROR (aResult, "failed to connect to server ("
     158                                          << CRX_ERROR ()
     159                                          << ") <"
     160                                          << aHttpRequest.GetHost ()
     161                                          << ":"
     162                                          << aHttpRequest.GetPort ()
     163                                          << "><"
     164                                          << aHttpRequest.GetURL ()
     165                                          << ">");
    161166                return aResult;
    162167            }
     
    167172        if (aResult != aReceivedSize)
    168173        {
    169             CRX_PRINT_ERROR (aResult, "failed to send to server (" << CRX_ERROR () << ")");
     174            CRX_PRINT_ERROR (aResult, "failed to send to server <"
     175                                          << aHttpRequest.GetHost ()
     176                                          << ":"
     177                                          << aHttpRequest.GetPort ()
     178                                          << CRX_ERROR ()
     179                                          << ")");
    170180            return aResult;
    171181        }
     
    179189            if (aResult < 0)
    180190            {
    181                 CRX_PRINT_ERROR (aResult, "failed to receive (" << CRX_ERROR () << ")");
     191                CRX_PRINT_ERROR (aResult, "failed to receive ("
     192                                          << CRX_ERROR ()
     193                                          << ") <"
     194                                          << aHttpRequest.GetURL ()
     195                                          << ">");
    182196                break;
    183197            }
     
    191205            if (aResult != aReceivedSize)
    192206            {
    193                 CRX_PRINT_ERROR (aResult, "failed to send (" << CRX_ERROR () << ")");
     207                CRX_PRINT_ERROR (aResult, "failed to send ("
     208                                          << CRX_ERROR ()
     209                                          << ") <"
     210                                          << aHttpRequest.GetURL ()
     211                                          << ">");
    194212                break;
    195213            }
Note: See TracChangeset for help on using the changeset viewer.