-
Notifications
You must be signed in to change notification settings - Fork 93
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
base: master
Are you sure you want to change the base?
Conversation
…entArgs. Updated Raygun4Net4 to pass through original exception.
…eption, throughout raygun4net framework.
Ensure API backwards compatibility
Formatting
Ensure API backwards compatibility
Ensure API backwards compatibility
Updating WinRT to allow exception obj during SendingMessage event
Must declare properties to build WindowsStore
Fix for Mindscape.Raygun4Net.NetCoreproject failing to load
Bump MVC provider version to 5.11.0
Give Raygun4Net.Core its own AssemblyVersion file.
Bump Raygun4Net.Core package to version 5.11.0
Bump raygun4net.core dependency version to 5.11.0
Bump versions to 5.11.0
Bump raygun4net provider version to 5.11.0
Separating Xamarin iOS from changes.
Separating Xamarin Android from changes.
Separating Xamarin Mac from changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 This change seems straightforward, nice work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have pointed out some methods that now require the new Exception parameter as they don't specify a default value, and I believe this would cause a breaking change.
I'm also going to point out this somewhat related blog post around being careful when using optional parameters. It suggests that adding optional parameters to an existing method can cause runtime exceptions if an application has not been compiled, but has a new version of a client library that has added optional parameters to existing methods. I would expect applications to typically be compiled when upgrading to newer versions of client libraries though, so maybe it's not a concern for us.
@@ -220,9 +220,9 @@ public static void Detach(HttpConfiguration config) | |||
_actionFilter = null; | |||
} | |||
} | |||
|
|||
|
|||
/// <summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment looks incorrect and could be deleted
@@ -53,16 +53,18 @@ private bool ValidateApiKey() | |||
private bool _handlingRecursiveErrorSending; | |||
|
|||
// Returns true if the message can be sent, false if the sending is canceled. | |||
protected bool OnSendingMessage(RaygunMessage raygunMessage) | |||
protected bool OnSendingMessage(RaygunMessage raygunMessage, Exception exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to give the exception parameter a default value of null here in case someone has an extension to this class and is calling this method?
@@ -71,7 +71,7 @@ private bool ValidateApiKey() | |||
private bool _handlingRecursiveErrorSending; | |||
|
|||
// Returns true if the message can be sent, false if the sending is canceled. | |||
protected bool OnSendingMessage(RaygunMessage raygunMessage) | |||
protected bool OnSendingMessage(RaygunMessage raygunMessage, Exception exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to give the exception parameter a default value of null here in case someone has an extension to this class and is calling this method?
@@ -279,9 +279,9 @@ public async Task SendAsync(Exception exception, IList<string> tags, IDictionary | |||
/// </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 async Task SendAsync(RaygunMessage raygunMessage) | |||
public async Task SendAsync(RaygunMessage raygunMessage, Exception exception) |
There was a problem hiding this comment.
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?
@@ -329,9 +329,9 @@ public void Send(Exception exception, IList<string> tags, IDictionary userCustom | |||
/// </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 Send(RaygunMessage raygunMessage) | |||
public void Send(RaygunMessage raygunMessage, Exception exception) |
There was a problem hiding this comment.
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?
Mindscape.Raygun4Net/RaygunClient.cs
Outdated
@@ -328,9 +328,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) |
There was a problem hiding this comment.
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?
@@ -60,16 +60,18 @@ protected void FlagAsSent(Exception exception) | |||
private bool _handlingRecursiveErrorSending; | |||
|
|||
// Returns true if the message can be sent, false if the sending is canceled. | |||
protected bool OnSendingMessage(RaygunMessage raygunMessage) | |||
protected bool OnSendingMessage(RaygunMessage raygunMessage, Exception exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to give the exception parameter a default value of null here in case someone has an extension to this class and is calling this method?
private RaygunMessage _raygunMessage; | ||
private Exception _exception; | ||
|
||
public RaygunSendingMessageEventArgs(RaygunMessage message, Exception exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlikely, but do we want to give the new exception parameter a null default, or keep in the old constructor as an overload - just in case someone is using the old constructor in which case this will be a breaking change.
@@ -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) |
There was a problem hiding this comment.
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?
@@ -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) |
There was a problem hiding this comment.
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?
Addressing PR comments
1661987
Update the
SendingMessage
event to include the original exception alongside theRaygunMessage
object. This allows customers to perform further operations on the exception to extract contextual information only available on the exception.Ticket: https://raygun.atlassian.net/browse/CR-204