Last active
August 29, 2015 14:02
-
-
Save sirkirby/8cf55d6f1368ded0017d to your computer and use it in GitHub Desktop.
try catch example using the raygun.diagnostics custom trace listener
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try {} | |
catch (Exception e) | |
{ | |
// any arg of type IList<string> will be treated as tags and any type of IDictionary will be treated as custom data | |
// any arg of type Exception will be wrapped in the primary raygun exception object | |
var customData = new Dictionary<string, object> {{"myType", someObject}; | |
var tags = new List<string> { "tag1", "tag1" }; | |
Trace.TraceError("Something bad happened", e, tags, customData); | |
// or inline with arg just added to a default Dictionary<object, object> object | |
Trace.TraceError("something bad happened", e, new List<string> {"tag1"}, someParameter, someObject); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment