Skip to content

Commit

Permalink
Docker --fast and no more sentry sending when 404
Browse files Browse the repository at this point in the history
  • Loading branch information
heynemann committed Sep 19, 2016
1 parent faa38ca commit 9bfd824
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 35 deletions.
6 changes: 6 additions & 0 deletions api/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type VersionMiddleware struct {
func (v *VersionMiddleware) Serve(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
c.Response().Header().Set(echo.HeaderServer, fmt.Sprintf("Khan/v%s", v.Version))
c.Response().Header().Set("Khan-Server", fmt.Sprintf("Khan/v%s", v.Version))
return next(c)
}
}
Expand All @@ -56,6 +57,11 @@ func (s *SentryMiddleware) Serve(next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
err := next(c)
if err != nil {
if httpErr, ok := err.(*echo.HTTPError); ok {
if httpErr.Code < 500 {
return err
}
}
tags := map[string]string{
"source": "app",
"type": "Internal server error",
Expand Down
Loading

0 comments on commit 9bfd824

Please sign in to comment.