Skip to content

Commit

Permalink
Wrap CurlHandler cert validation callback exceptions in HttpRequestEx…
Browse files Browse the repository at this point in the history
…ception (dotnet/corefx#21938)

* Wrap CurlHandler cert validation callback exceptions in HttpRequestException

* Address PR feedback


Commit migrated from dotnet/corefx@9d74fcf
  • Loading branch information
stephentoub authored Jul 6, 2017
1 parent 835ef47 commit da8094f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ internal CurlException(int error, string message) : base(message)
HResult = error;
}

internal CurlException(int error, Exception innerException) : base(GetCurlErrorString(error, isMulti:false), innerException)
{
HResult = error;
}

internal CurlException(int error, bool isMulti) : this(error, GetCurlErrorString(error, isMulti))
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private static int VerifyCertChain(IntPtr storeCtxPtr, IntPtr curlPtr)
catch (Exception exc)
{
EventSourceTrace("Unexpected exception: {0}", exc, easy: easy);
easy.FailRequest(exc);
easy.FailRequest(CreateHttpRequestException(new CurlException((int)CURLcode.CURLE_ABORTED_BY_CALLBACK, exc)));
return FailureResult;
}
finally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public async Task UseCallback_CallbackReturnsFailure_ThrowsException()
}
}

[ActiveIssue(21904)]
[OuterLoop] // TODO: Issue #11345
[Fact]
public async Task UseCallback_CallbackThrowsException_ExceptionPropagates()
Expand Down

0 comments on commit da8094f

Please sign in to comment.