Skip to content

Commit

Permalink
Version 2.1.1 (#23)
Browse files Browse the repository at this point in the history
added web proxy property to BacktraceCredential object
  • Loading branch information
konraddysput authored Mar 18, 2019
1 parent 675c92d commit dc6f2f6
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Backtrace/Backtrace.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
<TargetFrameworks>netstandard2.0;net45;net35</TargetFrameworks>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageTags>Backtrace Error Diagnostic Tools Debug Bug Bugs StackTrace</PackageTags>
<PackageVersion>2.1.0</PackageVersion>
<PackageVersion>2.1.1</PackageVersion>
<Product>Backtrace</Product>
<PackageLicenseUrl>https://github.com/backtrace-labs/backtrace-csharp/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/backtrace-labs/backtrace-csharp</PackageProjectUrl>
<PackageIconUrl>http://backtrace.io/images/icon.png</PackageIconUrl>
<Description>Backtrace's integration with C# applications allows customers to capture and report handled and unhandled C# exceptions to their Backtrace instance, instantly offering the ability to prioritize and debug software errors.</Description>
<RepositoryUrl>https://github.com/backtrace-labs/backtrace-csharp</RepositoryUrl>
<NeutralLanguage>en</NeutralLanguage>
<Version>2.1.0</Version>
<Version>2.1.1</Version>
<Copyright>Backtrace I/O</Copyright>
<Authors>Backtrace I/O</Authors>
<Company>Backtrace I/O</Company>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
<FileVersion>2.1.0.0</FileVersion>
<AssemblyVersion>2.1.1.0</AssemblyVersion>
<FileVersion>2.1.1.0</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
7 changes: 6 additions & 1 deletion Backtrace/Model/BacktraceCredentials.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Specialized;
using System.Configuration;
using System.Net;
using System.Text;

namespace Backtrace.Model
Expand Down Expand Up @@ -38,6 +39,10 @@ internal string Token
}
}

#if !NET35
public WebProxy Proxy { get; set; } = null;
#endif

/// <summary>
/// Create submission url to Backtrace API
/// </summary>
Expand All @@ -63,7 +68,7 @@ internal Uri GetSubmissionUrl()
{
uriBuilder.Scheme = $"https://{uriBuilder.Scheme}";
}
if(!uriBuilder.Path.EndsWith("/") && !string.IsNullOrEmpty(uriBuilder.Path))
if (!uriBuilder.Path.EndsWith("/") && !string.IsNullOrEmpty(uriBuilder.Path))
{
uriBuilder.Path += "/";
}
Expand Down
16 changes: 15 additions & 1 deletion Backtrace/Services/BacktraceApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,28 @@ public BacktraceApi(BacktraceCredentials credentials, uint reportPerMin = 3)
}
_serverurl = credentials.GetSubmissionUrl();
reportLimitWatcher = new ReportLimitWatcher(reportPerMin);
#if !NET35
InitializeHttpClient(credentials.Proxy);
#endif
}
#region asyncRequest
#if !NET35

/// <summary>
/// The http client.
/// </summary>
internal HttpClient HttpClient = new HttpClient();
internal HttpClient HttpClient;
private void InitializeHttpClient(WebProxy proxy)
{
if (proxy != null)
{
HttpClient = new HttpClient(new HttpClientHandler() { Proxy = proxy }, true);
}
else
{
HttpClient = new HttpClient();
}
}

public async Task<BacktraceResult> SendAsync(BacktraceData data)
{
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Backtrace C# Release Notes

## Version 2.1.1 - 18.03.2019
- `BacktraceCredentials` allows you to pass `WebProxy` object to `Proxy` property. `BacktraceApi` will use proxy object to create `HttpClient`

## Version 2.1.0 - 10.03.2019

Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Backtrace
[![Backtrace@release](https://img.shields.io/badge/Backtrace%40master-2.1.0-blue.svg)](https://www.nuget.org/packages/Backtrace)
[![Backtrace@release](https://img.shields.io/badge/Backtrace%40master-2.1.1-blue.svg)](https://www.nuget.org/packages/Backtrace)
[![Build status](https://ci.appveyor.com/api/projects/status/o0n9sp0ydgxb3ktu?svg=true)](https://ci.appveyor.com/project/konraddysput/backtrace-csharp)

[![Backtrace@pre-release](https://img.shields.io/badge/Backtrace%40dev-2.1.1-blue.svg)](https://www.nuget.org/packages/Backtrace)
[![Backtrace@pre-release](https://img.shields.io/badge/Backtrace%40dev-2.1.2-blue.svg)](https://www.nuget.org/packages/Backtrace)
[![Build status](https://ci.appveyor.com/api/projects/status/o0n9sp0ydgxb3ktu/branch/dev?svg=true)](https://ci.appveyor.com/project/konraddysput/backtrace-csharp/branch/dev)


Expand Down Expand Up @@ -191,6 +191,7 @@ For more information on `BacktraceClientConfiguration` parameters please see <a

Notes:
- If parameter `reportPerMin` is equal to 0, there is no limit on the number of error reports per minute. When the `reportPerMin` cap is reached, `BacktraceClient.Send/BacktraceClient.SendAsync` method will return false,
- If you develop application behind the proxy you can pass `WebProxy` object to `BacktraceCredentials` object. We will try to use `WebProxy` object when user pass it to `Backtrace`. To setup proxy use property `Proxy`,
- `BacktraceClient` allows you to unpack `AggregateExceptions` and send only exceptions that are available in `InnerException` property of `AggregateException`. By default `BacktraceClient` will send `AggregateException` information to Backtrace server. To avoid sending these reports, please override `UnpackAggregateException` and set value to `true`.


Expand Down

0 comments on commit dc6f2f6

Please sign in to comment.