func (wrapper *Sentry) Capture(err error, _panic bool) {
	if err != nil {
		if wrapper.client != nil && !errors.Ignore(err) {
			sentry.WithScope(func(scope *sentry.Scope) {
				if extras := errors.Extras(err); extras != nil{
					scope.SetExtras(extras)
					scope.SetExtra("stacktrace", errors.Stacktrace(err))
				} else {
					scope.SetExtras(map[string]interface{}{
						"stacktrace": errors.Stacktrace(err),
					})
				}
				scope.SetTags(errors.Tags(err))
				eventId := sentry.CaptureException(err)
				log.Errorf(err, "Error captured in sentry with the event ID `%s`", *eventId)
			})
		} else {
			log.Error(err)
		}
		if _panic {
			panic(err)
		}
	}
}
Handles an error by capturing it on Sentry and logging the same on STDOUT
package surveillance
import (
	"context"
	"net/http"
	"os"
	"github.com/Vernacular-ai/vcore/errors"
	"github.com/Vernacular-ai/vcore/log"
	sentryWrapper "github.com/Vernacular-ai/vcore/sentry"
	"github.com/getsentry/sentry-go"
	"github.com/getsentry/sentry-go/http"
	"github.com/julienschmidt/httprouter"
	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)
type Sentry struct {
	client  *sentry.Client
	handler *sentryWrapper.Handler
}
func InitSentry(release string) (client *Sentry) {
	dsn := os.Getenv("SENTRY_DSN")
	if release == "" {
		release = os.Getenv("SENTRY_RELEASE")
	}
	if dsn != "" {
		if err := sentry.Init(sentry.ClientOptions{
			Dsn: dsn,
			AttachStacktrace: true,
			Release: release,
			Environment: os.Getenv("ENVIRONMENT"),
		}); err != nil {
			log.Warnf("Could not initialize sentry with DSN: %s", dsn)
			client = &Sentry{nil, nil}
		} else {
			client = &Sentry{
				sentry.CurrentHub().Client(),
				sentryWrapper.New(sentryhttp.Options{Repanic: true}),
			}
		}
	} else {
		log.Warnf("Could not initialize sentry with DSN: %s", dsn)
		client = &Sentry{nil, nil}
	}
	return
}
var (
	SentryClient = InitSentry("")
)