Skip to content

Instantly share code, notes, and snippets.

@steve-torchia
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steve-torchia/96801fee770a04fd86f9 to your computer and use it in GitHub Desktop.
Save steve-torchia/96801fee770a04fd86f9 to your computer and use it in GitHub Desktop.
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