Skip to content

Commit 9d19dba

Browse files
authored
Merge pull request #47 from RoushTech/release/0.5.1
Release/0.5.1
2 parents d76e3d5 + 1a6732f commit 9d19dba

File tree

6 files changed

+25
-11
lines changed

6 files changed

+25
-11
lines changed

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
# 0.5.0
2-
<sup>Released: TBD</sup>
1+
# 0.5.1
2+
<sup>Released: 2017/3/10</sup>
3+
4+
## Features
5+
6+
- More robust testing of sending exceptions to Rollbar (see readme.md for instructions on configuring token for testing).
7+
8+
## Bug Fixes
9+
10+
- Fixed issue sending Rollbar exceptions.
11+
12+
# 0.5.0
13+
<sup>Released: 2017/2/26</sup>
314

415
## Features
516

Readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Rollbar support for your .NET Core projects, relies on dependency injection and
44

55
Inspired by RollbarSharp, great library, just required too many tweaks to make play with .NET core well in my opinion.
66

7+
# Testing
8+
9+
Environment variables for testing:
10+
11+
* ROLLBAR_TOKEN - Rollbar token for testing.
12+
713
# Required services
814

915
Please make sure the following services are available for the various builder modules.

src/RollbarDotNet/Payloads/Body.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public class Body
88
{
99
public Body()
1010
{
11-
this.Message = new Message();
1211
}
1312

1413
[JsonProperty("trace")]

src/RollbarDotNet/Rollbar.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public async Task<Response> SendMessage(string message)
4646
public async Task<Response> SendMessage(RollbarLevel level, string message)
4747
{
4848
var payload = this.SetupPayload(level);
49+
payload.Data.Body.Message = new Message();
4950
payload.Data.Body.Message.Body = message;
5051
return await this.RollbarClient.Send(payload);
5152
}

src/RollbarDotNet/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"Error"
1616
]
1717
},
18-
"version": "0.5.0",
18+
"version": "0.5.1",
1919
"dependencies": {
2020
"Microsoft.AspNetCore.Hosting.Abstractions": "1.0.0",
2121
"Microsoft.AspNetCore.Http": "1.0.0",

test/RollbarDotNet.Tests/DependencyInjection/WebDependencyInjectionTests.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using Microsoft.Extensions.DependencyInjection;
77
using Moq;
88
using System;
9-
using System.Net.Http;
109
using System.Threading.Tasks;
1110
using Xunit;
1211

@@ -19,10 +18,9 @@ public WebDependencyInjectionTests()
1918
services.AddOptions()
2019
.AddRollbarWeb()
2120
.AddSingleton(mockHostingEnvironment.Object);
22-
2321
services.Configure<RollbarOptions>(o =>
2422
{
25-
o.AccessToken = "test";
23+
o.AccessToken = Environment.GetEnvironmentVariable("ROLLBAR_TOKEN");
2624
o.Environment = "Testing";
2725
});
2826

@@ -46,21 +44,20 @@ public async Task SucessfullyReportError()
4644
}
4745
catch(Exception exception)
4846
{
49-
// We're expecting a 401 due to the bad access token, anything else means we failed to DI.
50-
await Assert.ThrowsAsync<HttpRequestException>(async () => await this.Rollbar.SendException(exception));
47+
await this.Rollbar.SendException(exception);
5148
}
5249
}
5350

5451
[Fact]
5552
public async Task SuccessfullyReportMessage()
5653
{
57-
await Assert.ThrowsAsync<HttpRequestException>(async () => await this.Rollbar.SendMessage("Hello"));
54+
await this.Rollbar.SendMessage("Hello");
5855
}
5956

6057
[Fact]
6158
public async Task SuccessfullyReportMessageWithLevel()
6259
{
63-
await Assert.ThrowsAsync<HttpRequestException>(async () => await this.Rollbar.SendMessage(RollbarLevel.Debug, "Hello"));
60+
await this.Rollbar.SendMessage(RollbarLevel.Debug, "Hello");
6461
}
6562
}
6663
}

0 commit comments

Comments
 (0)