MindscapeHQ/raygun4go

Document _CreateError_ and _SendError_ on Readme

AndersonQ opened this issue · 1 comments

I was integrating Raygun for the first time in a Go application, reading the documentation and the readme I could not find any reference to methods to send an error wich is not a panic. Which is quite misleading, as they exist. Beside Go applications hardly panic (CLIs usually do a lot more often than web servers/microservices). Thus I was considering raygun4go almost useless. I only found these methods out after have forked it and exposed them myself.

A section under Basic Usage could be added showing a example of them

The methiods I'm referring to are:

// Manually send a new error with the given message to Raygun. This will use the current execution stacktrace.
func (c *Client) CreateError(message string) error

// Manually send the given error to Raygun.
// If the given error is a "github.com/go-errors/errors".Error, then its stacktrace will be used in the Raygun report.
// For other errors, the current execution stacktrace is used in the Raygun report.
func (c *Client) SendError(error error) error

I'm happy to open the PR

Thanks for the PR, I've merged that in now. I've also updated our site documentation to explain manually sending errors to Raygun.