-
-
Save steve-torchia/96801fee770a04fd86f9 to your computer and use it in GitHub Desktop.
This file contains 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
void Main() | |
{ | |
var exception = new JsException("testing message", "stack\ntrace\nhere"); | |
var rayGun = new RaygunClient((); | |
rayGun.SendInBackground(exception); | |
Console.WriteLine(exception.ToString()); | |
/* | |
expecting to see this : | |
testing message | |
stack | |
trace | |
here | |
but instead see this: | |
testing message | |
none | |
*/ | |
} | |
public class JsException : Exception | |
{ | |
private readonly string _stack; | |
public JsException(string message, string stack = null) | |
: base(message) | |
{ | |
_stack = stack; | |
} | |
public override string StackTrace | |
{ | |
get { return _stack; } | |
} | |
public override string ToString() | |
{ | |
if (string.IsNullOrWhiteSpace(_stack)) | |
{ | |
return base.ToString(); | |
} | |
return Message + Environment.NewLine + _stack; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment