Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(305)

Unified Diff: Src/GoogleApis/Apis/Http/IHttpExceptionHandler.cs

Issue 13412046: Reimplement OAuth2 library - Step 1 (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Patch Set: minor Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Src/GoogleApis/Apis/Http/IHttpExceptionHandler.cs
===================================================================
--- a/Src/GoogleApis/Apis/Http/IHttpExceptionHandler.cs
b/Src/GoogleApis/Apis/Http/IHttpExceptionHandler.cs
@@ -15,46 15,44 @@
*/
using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Net.Http;
-using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Google.Apis.Http
{
- /// <summary> Argument class to <see cref="IHttpExceptionHandler.HandleException"/>.</summary>
/// <summary>Argument class to <see cref="IHttpExceptionHandler.HandleExceptionAsync"/>.</summary>
public class HandleExceptionArgs
{
- /// <summary> Gets or sets the sent request.</summary>
/// <summary>Gets or sets the sent request.</summary>
public HttpRequestMessage Request { get; set; }
- /// <summary> Gets or sets the exception which occurred during sending the request.</summary>
/// <summary>Gets or sets the exception which occurred during sending the request.</summary>
public Exception Exception { get; set; }
- /// <summary> Gets or sets the total number of tries to send the request.</summary>
/// <summary>Gets or sets the total number of tries to send the request.</summary>
public int TotalTries { get; set; }
- /// <summary> Gets or sets the current failed try.</summary>
/// <summary>Gets or sets the current failed try.</summary>
public int CurrentFailedTry { get; set; }
- /// <summary> Gets whether there will actually be a retry if the handler returns <c>true</c>.</summary>
/// <summary>Gets whether there will actually be a retry if the handler returns <c>true</c>.</summary>
public bool SupportsRetry
{
get { return TotalTries - CurrentFailedTry > 0; }
}
- /// <summary> Gets and sets the cancellation token which belongs to the request.</summary>
/// <summary>Gets and sets the cancellation token which belongs to the request.</summary>
public CancellationToken CancellationToken { get; set; }
}
- /// <summary>
- /// Exception handler which is invoked when an exception is thrown during an Http request.
/// <summary>
/// Exception handler which is invoked when an exception is thrown during a HTTP request.
/// </summary>
public interface IHttpExceptionHandler
{
/// <summary>
- /// Handles an exception thrown when sending an Http request.
/// Handles an exception thrown when sending a HTTP request.
/// A simple rule must be followed, if you modify the request object in a way that the exception can be
/// resolved, you must return <c>true</c>.
/// </summary>
@@ -62,6 60,6 @@
/// Handle exception argument which contains properties like the request, the exception, current failed try.
/// </param>
/// <returns>Whether or not this handler has made a change that will require the request to be resent</returns>
- bool HandleException(HandleExceptionArgs args);
Task<bool> HandleExceptionAsync(HandleExceptionArgs args);
}
}

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b