private async Task DaprHttpCall()

in src/Microsoft.Azure.WebJobs.Extensions.Dapr/Services/DaprHttpClient.cs [126:152]


        private async Task<HttpResponseMessage> DaprHttpCall(ILogger logger, Func<Task<HttpResponseMessage>> httpCall)
        {
            try
            {
                var response = await httpCall();
                await this.ThrowIfDaprFailure(logger, response);

                return response;
            }
            catch (HttpRequestException ex) when (ex.InnerException is SocketException socketException)
            {
                if (socketException.SocketErrorCode == SocketError.ConnectionRefused)
                {
                    throw new DaprSidecarNotPresentException(HttpStatusCode.ServiceUnavailable, ErrorCodes.ErrDaprSidecarDoesNotExist, "Dapr sidecar is not present. Please see (https://aka.ms/azure-functions-dapr-sidecar-missing) for more.", ex);
                }

                throw new DaprException(HttpStatusCode.InternalServerError, ErrorCodes.ErrDaprRequestFailed, ex.Message, ex);
            }
            catch (DaprException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw new DaprException(HttpStatusCode.InternalServerError, ErrorCodes.ErrDaprRequestFailed, ex.Message, ex);
            }
        }