Skip to content

go-problem-reporter captures HTTP responses that conform to RFC7807 Problem Details from your web application and sends to error reporting services.

License

Notifications You must be signed in to change notification settings

aereal/go-problem-reporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

status PkgGoDev

go-problem-reporter

go-problem-reporter captures HTTP responses that conform to RFC7807 Problem Details from your web application and sends to error reporting services.

Currently supported services:

Synopsis

package main

import (
  "github.com/getsentry/sentry-go"
  "github.com/moogar0880/problems"
  sentryhttp "github.com/getsentry/sentry-go/http"
  sentryreporter "github.com/aereal/go-problem-reporter/sentry"
)

func main() {
  h := http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
    p := problems.NewDetailedProblem(http.StatusInternalServerError, "some details"),
    problems.StatusProblemHandler(p).ServeHTTP(rw, r)
  })
  mw := sentryreporter.New(sentryreporter.Options{WaitForDelivery: true})
  withSentryHub := sentryhttp.New(sentryhttp.Options{}).Handle
  &http.Server{
    Handler: withSentryHub(mw(h)),
  }
}

Installation

go get github.com/aereal/go-problem-reporter

License

See LICENSE file.

About

go-problem-reporter captures HTTP responses that conform to RFC7807 Problem Details from your web application and sends to error reporting services.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages