Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CR-204] Have the SendingMessage event include the original exception #434

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
82d6606
Add original exception to SendingMessage handler and SendingMessageEv…
MattByers Jul 14, 2020
05d5ca4
Update references to the SendingMessage event to include original exc…
MattByers Jul 15, 2020
22d279b
Make Send RaygunMessage method take a nullable exception.
MattByers Jul 16, 2020
266ce2a
Ensure API backwards compatibility
mduncan26 Jul 17, 2020
554cf29
Formatting
mduncan26 Jul 17, 2020
9bdb9ce
Ensure API backwards compatibility
mduncan26 Jul 17, 2020
55ba5b2
Ensure API backwards compatibility
mduncan26 Jul 17, 2020
3858cdf
Updating WinRT to allow exception obj during SendingMessage event
mduncan26 Jul 17, 2020
b408c91
Must declare properties to build WindowsStore
mduncan26 Jul 17, 2020
673114b
Fix for Mindscape.Raygun4Net.NetCoreproject failing to load
mduncan26 Jul 17, 2020
5f6873f
Bump MVC provider version to 5.11.0
mduncan26 Jul 19, 2020
39154b0
Give Raygun4Net.Core its own AssemblyVersion file.
mduncan26 Jul 19, 2020
02572e6
Bump Raygun4Net.Core package to version 5.11.0
mduncan26 Jul 19, 2020
5b82b48
Bump raygun4net.core dependency version to 5.11.0
mduncan26 Jul 19, 2020
6f01287
Bump versions to 5.11.0
mduncan26 Jul 19, 2020
62b681a
Bump raygun4net provider version to 5.11.0
mduncan26 Jul 19, 2020
e297897
Separating Xamarin iOS from changes.
mduncan26 Jul 20, 2020
5e2596f
Separating Xamarin Android from changes.
mduncan26 Jul 20, 2020
3bb59e2
Separating Xamarin Mac from changes.
mduncan26 Jul 20, 2020
1661987
Addressing PR comments
mduncan26 Jul 28, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AssemblyVersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.10.2.0")]
[assembly: AssemblyFileVersion("5.10.2.0")]
[assembly: AssemblyVersion("5.11.0.0")]
[assembly: AssemblyFileVersion("5.11.0.0")]
16 changes: 8 additions & 8 deletions Mindscape.Raygun4Net.ClientProfile.Tests/RaygunClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public void UserCustomData()
[Test]
public void NoHandlerSendsAll()
{
Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
}

[Test]
Expand All @@ -310,7 +310,7 @@ public void HandlerIsChecked()
filterCalled = true;
e.Cancel = true;
};
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
Assert.IsTrue(filterCalled);
}

Expand All @@ -321,7 +321,7 @@ public void HandlerCanAllowSend()
{
// Allow send by not setting e.Cancel
};
Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
}

[Test]
Expand All @@ -341,7 +341,7 @@ public void AllHandlersAreChecked()
filter2Called = true;
e.Cancel = true;
};
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
Assert.IsTrue(filter1Called);
Assert.IsTrue(filter2Called);
}
Expand All @@ -357,7 +357,7 @@ public void DontSendIfFirstHandlerCancels()
{
// Allow send by not setting e.Cancel
};
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
}

[Test]
Expand All @@ -371,7 +371,7 @@ public void DontSendIfSecondHandlerCancels()
{
e.Cancel = true;
};
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
}

[Test]
Expand All @@ -385,7 +385,7 @@ public void AllowSendIfNoHandlerCancels()
{
// Allow send by not setting e.Cancel
};
Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
}

[Test]
Expand All @@ -399,7 +399,7 @@ public void HandlerCanModifyMessage()
e.Message.Details.Error.Message = "Custom error message";
};

Assert.IsTrue(_client.ExposeOnSendingMessage(message));
Assert.IsTrue(_client.ExposeOnSendingMessage(message, _exception));
Assert.AreEqual("Custom error message", message.Details.Error.Message);
}

Expand Down
16 changes: 9 additions & 7 deletions Mindscape.Raygun4Net.ClientProfile/RaygunClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void RemoveWrapperExceptions(params Type[] wrapperExceptions)
_wrapperExceptions.Remove(wrapper);
}
}

/// <summary>
/// Transmits an exception to Raygun.io synchronously, using the version number of the originating assembly.
/// </summary>
Expand Down Expand Up @@ -140,7 +140,7 @@ public void Send(Exception exception, IList<string> tags, IDictionary userCustom
{
if (CanSend(exception))
{
Send(BuildMessage(exception, tags, userCustomData, userInfo, null));
Send(BuildMessage(exception, tags, userCustomData, userInfo, null), exception);
FlagAsSent(exception);
}
}
Expand Down Expand Up @@ -191,7 +191,7 @@ public void SendInBackground(Exception exception, IList<string> tags, IDictionar
{
try
{
Send(BuildMessage(exception, tags, userCustomData, userInfo, currentTime));
Send(BuildMessage(exception, tags, userCustomData, userInfo, currentTime), exception);
}
catch (Exception)
{
Expand All @@ -212,9 +212,10 @@ public void SendInBackground(Exception exception, IList<string> tags, IDictionar
/// </summary>
/// <param name="raygunMessage">The RaygunMessage to send. This needs its OccurredOn property
/// set to a valid DateTime and as much of the Details property as is available.</param>
public void SendInBackground(RaygunMessage raygunMessage)
/// <param name="exception">The original exception that generated the RaygunMessage</param>
public void SendInBackground(RaygunMessage raygunMessage, Exception exception)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the new exception parameter doesn't have a default value, couldn't this cause a breaking change?

{
ThreadPool.QueueUserWorkItem(c => Send(raygunMessage));
ThreadPool.QueueUserWorkItem(c => Send(raygunMessage, exception));
}

protected RaygunMessage BuildMessage(Exception exception, IList<string> tags, IDictionary userCustomData)
Expand Down Expand Up @@ -266,9 +267,10 @@ private Exception StripWrapperExceptions(Exception exception)
/// </summary>
/// <param name="raygunMessage">The RaygunMessage to send. This needs its OccurredOn property
/// set to a valid DateTime and as much of the Details property as is available.</param>
public override void Send(RaygunMessage raygunMessage)
/// <param name="exception">The original exception that generated the RaygunMessage</param>
public override void Send(RaygunMessage raygunMessage, Exception exception = null)
{
bool canSend = OnSendingMessage(raygunMessage);
bool canSend = OnSendingMessage(raygunMessage, exception);
if (canSend)
{
string message = null;
Expand Down
2 changes: 1 addition & 1 deletion Mindscape.Raygun4Net.Core.Signed.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>Mindscape.Raygun4Net.Core.Signed</id>
<version>5.10.2</version>
<version>5.11.0</version>
<title />
<authors>Raygun</authors>
<owners />
Expand Down
2 changes: 1 addition & 1 deletion Mindscape.Raygun4Net.Core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>Mindscape.Raygun4Net.Core</id>
<version>5.10.2</version>
<version>5.11.0</version>
<title />
<authors>Raygun</authors>
<owners />
Expand Down
4 changes: 1 addition & 3 deletions Mindscape.Raygun4Net.Core/Mindscape.Raygun4Net.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\AssemblyVersionInfo.cs">
<Link>Properties\AssemblyVersionInfo.cs</Link>
</Compile>
<Compile Include="..\Mindscape.Raygun4Net\Attributes\DoNotProfileAttribute.cs">
<Link>Attributes\DoNotProfileAttribute.cs</Link>
</Compile>
Expand Down Expand Up @@ -135,6 +132,7 @@
<Compile Include="..\Mindscape.Raygun4Net\Filters\RaygunKeyValuePairDataFilter.cs">
<Link>Filters\RaygunKeyValuePairDataFilter.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyVersionInfo.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Filters\" />
Expand Down
14 changes: 14 additions & 0 deletions Mindscape.Raygun4Net.Core/Properties/AssemblyVersionInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Reflection;

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.11.0.0")]
[assembly: AssemblyFileVersion("5.11.0.0")]
4 changes: 2 additions & 2 deletions Mindscape.Raygun4Net.Mvc.Signed.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>Mindscape.Raygun4Net.Mvc.Signed</id>
<version>5.10.3</version>
<version>5.11.0</version>
<title />
<authors>Raygun</authors>
<owners />
Expand All @@ -12,7 +12,7 @@
<projectUrl>https://github.com/MindscapeHQ/raygun4net</projectUrl>
<licenseUrl>https://raw.github.com/MindscapeHQ/raygun4net/master/LICENSE</licenseUrl>
<dependencies>
<dependency id="Mindscape.Raygun4Net.Core.Signed" version="5.10.2" />
<dependency id="Mindscape.Raygun4Net.Core.Signed" version="5.11.0" />
</dependencies>
</metadata>
<files>
Expand Down
4 changes: 2 additions & 2 deletions Mindscape.Raygun4Net.Mvc.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>Mindscape.Raygun4Net.Mvc</id>
<version>5.10.3</version>
<version>5.11.0</version>
<title />
<authors>Raygun</authors>
<owners />
Expand All @@ -12,7 +12,7 @@
<projectUrl>https://github.com/MindscapeHQ/raygun4net</projectUrl>
<licenseUrl>https://raw.github.com/MindscapeHQ/raygun4net/master/LICENSE</licenseUrl>
<dependencies>
<dependency id="Mindscape.Raygun4Net.Core" version="5.10.2" />
<dependency id="Mindscape.Raygun4Net.Core" version="5.11.0" />
</dependencies>
</metadata>
<files>
Expand Down
4 changes: 2 additions & 2 deletions Mindscape.Raygun4Net.Mvc/Properties/AssemblyVersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.10.3.0")]
[assembly: AssemblyFileVersion("5.10.3.0")]
[assembly: AssemblyVersion("5.11.0.0")]
[assembly: AssemblyFileVersion("5.11.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<AssemblyName>Mindscape.Raygun4Net.NetCore</AssemblyName>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<TargetFrameworks>netstandard1.6;netstandard2.0</TargetFrameworks>
<TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Configurations>Debug;Release;Sign</Configurations>
<Platforms>AnyCPU</Platforms>
Expand Down
2 changes: 1 addition & 1 deletion Mindscape.Raygun4Net.Signed.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>Mindscape.Raygun4Net.Signed</id>
<version>5.10.2</version>
<version>5.11.0</version>
<title />
<authors>Raygun</authors>
<owners />
Expand Down
4 changes: 2 additions & 2 deletions Mindscape.Raygun4Net.Tests/Model/FakeRaygunClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public bool ExposeValidateApiKey()
return ValidateApiKey();
}

public bool ExposeOnSendingMessage(RaygunMessage raygunMessage)
public bool ExposeOnSendingMessage(RaygunMessage raygunMessage, Exception exception)
{
return OnSendingMessage(raygunMessage);
return OnSendingMessage(raygunMessage, exception);
}

public bool ExposeCanSend(Exception exception)
Expand Down
4 changes: 2 additions & 2 deletions Mindscape.Raygun4Net.Tests/RaygunClientBaseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public void ExceptionInsideSendingMessageHAndlerDoesNotCrash()
throw new Exception("Oops...");
};

Assert.That(() => client.ExposeOnSendingMessage(new RaygunMessage()), Throws.Nothing);
Assert.IsTrue(client.ExposeOnSendingMessage(new RaygunMessage()));
Assert.That(() => client.ExposeOnSendingMessage(new RaygunMessage(), new Exception()), Throws.Nothing);
Assert.IsTrue(client.ExposeOnSendingMessage(new RaygunMessage(), new Exception()));
}
}
}
16 changes: 8 additions & 8 deletions Mindscape.Raygun4Net.Tests/RaygunClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public void UserCustomData()
[Test]
public void NoHandlerSendsAll()
{
Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
}

[Test]
Expand All @@ -318,7 +318,7 @@ public void HandlerIsChecked()
filterCalled = true;
e.Cancel = true;
};
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
Assert.IsTrue(filterCalled);
}

Expand All @@ -329,7 +329,7 @@ public void HandlerCanAllowSend()
{
// Allow send by not setting e.Cancel
};
Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
}

[Test]
Expand All @@ -349,7 +349,7 @@ public void AllHandlersAreChecked()
filter2Called = true;
e.Cancel = true;
};
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
Assert.IsTrue(filter1Called);
Assert.IsTrue(filter2Called);
}
Expand All @@ -365,7 +365,7 @@ public void DontSendIfFirstHandlerCancels()
{
// Allow send by not setting e.Cancel
};
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
}

[Test]
Expand All @@ -379,7 +379,7 @@ public void DontSendIfSecondHandlerCancels()
{
e.Cancel = true;
};
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsFalse(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
}

[Test]
Expand All @@ -393,7 +393,7 @@ public void AllowSendIfNoHandlerCancels()
{
// Allow send by not setting e.Cancel
};
Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception)));
Assert.IsTrue(_client.ExposeOnSendingMessage(_client.ExposeBuildMessage(_exception), _exception));
}

[Test]
Expand All @@ -407,7 +407,7 @@ public void HandlerCanModifyMessage()
e.Message.Details.Error.Message = "Custom error message";
};

Assert.IsTrue(_client.ExposeOnSendingMessage(message));
Assert.IsTrue(_client.ExposeOnSendingMessage(message, _exception));
Assert.AreEqual("Custom error message", message.Details.Error.Message);
}

Expand Down
4 changes: 2 additions & 2 deletions Mindscape.Raygun4Net.WebApi.Signed.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>Mindscape.Raygun4Net.WebApi.Signed</id>
<version>5.10.3</version>
<version>5.11.0</version>
<title>Raygun for ASP.NET Web API</title>
<authors>Raygun</authors>
<owners />
Expand All @@ -13,7 +13,7 @@
<projectUrl>https://github.com/MindscapeHQ/raygun4net</projectUrl>
<licenseUrl>https://raw.github.com/MindscapeHQ/raygun4net/master/LICENSE</licenseUrl>
<dependencies>
<dependency id="Mindscape.Raygun4Net.Core.Signed" version="5.10.2" />
<dependency id="Mindscape.Raygun4Net.Core.Signed" version="5.11.0" />
</dependencies>
</metadata>
<files>
Expand Down
4 changes: 2 additions & 2 deletions Mindscape.Raygun4Net.WebApi.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>Mindscape.Raygun4Net.WebApi</id>
<version>5.10.3</version>
<version>5.11.0</version>
<title>Raygun for ASP.NET Web API</title>
<authors>Raygun</authors>
<owners />
Expand All @@ -13,7 +13,7 @@
<projectUrl>https://github.com/MindscapeHQ/raygun4net</projectUrl>
<licenseUrl>https://raw.github.com/MindscapeHQ/raygun4net/master/LICENSE</licenseUrl>
<dependencies>
<dependency id="Mindscape.Raygun4Net.Core" version="5.10.2" />
<dependency id="Mindscape.Raygun4Net.Core" version="5.11.0" />
</dependencies>
</metadata>
<files>
Expand Down
4 changes: 2 additions & 2 deletions Mindscape.Raygun4Net.WebApi/Properties/AssemblyVersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("5.10.3.0")]
[assembly: AssemblyFileVersion("5.10.3.0")]
[assembly: AssemblyVersion("5.11.0.0")]
[assembly: AssemblyFileVersion("5.11.0.0")]
Loading