Send custom error (not customData)
gonace
Posted on
Jan 17 2014
I'm wondering if there's a way to create you own error object and send to RayGun? I want to send a custom error to RayGun that is not from try/catch.
For example set up your own payload and send to RayGun?
Is this possible?
John-Daniel Trask
Raygun
Posted on
Jan 17 2014
This is most definitely possible, but the exact way you do it depends on what language and provider you are using. The generic way is to simply instantiate an Exception or Error object with the appropriate data (message etc), and pass that to the RaygunClient by calling Send() and passing in your exception object as the parameter.
Let us know what language you're using and I can help you further.
Regards,
Callum Gavin
Software Developer
Mindscape
gonace
Posted on
Jan 17 2014
Hi I'm using javascript :)
John-Daniel Trask
Raygun
Posted on
Jan 21 2014
Try something like this:
`Raygun.init('apikey');
Raygun.send(new Error('Your Custom Error'));
.
If send() existing within a function, or a series of nested functions, the stack trace will contain them as usual, as well as the line/col numbers.
Hope this helps!
gonace
Posted on
Jan 21 2014
Sweet thanks :)