From 308aab92cfdbee11dbd608a30b2fa77ddade1b31 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 4 Jul 2015 00:25:13 +0300 Subject: [PATCH] Also print response body on 401 --- libgrive/src/protocol/AuthAgent.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libgrive/src/protocol/AuthAgent.cc b/libgrive/src/protocol/AuthAgent.cc index e24d4e0..b7cb0c9 100644 --- a/libgrive/src/protocol/AuthAgent.cc +++ b/libgrive/src/protocol/AuthAgent.cc @@ -161,7 +161,7 @@ bool AuthAgent::CheckRetry( long response ) // HTTP 500 and 503 should be temporary. just wait a bit and retry if ( response == 500 || response == 503 ) { - Log( "request failed due to temporary error: %1%, body: %2%. retrying in 5 seconds", + Log( "request failed due to temporary error: %1% (body: %2%). retrying in 5 seconds", response, m_agent->LastError(), log::warning ) ; os::Sleep( 5 ) ; @@ -171,8 +171,8 @@ bool AuthAgent::CheckRetry( long response ) // HTTP 401 Unauthorized. the auth token has been expired. refresh it else if ( response == 401 ) { - Log( "request failed due to auth token expired: %1%. refreshing token", - response, log::warning ) ; + Log( "request failed due to auth token expired: %1% (body: %2%). refreshing token", + response, m_agent->LastError(), log::warning ) ; os::Sleep( 5 ) ; m_auth.Refresh() ;