Skip to content

Commit

Permalink
chore: add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnu-deepsource committed Oct 12, 2023
1 parent c098404 commit e835348
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/runner/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import (
"github.com/deepsourcecorp/runner/httperror"
"github.com/getsentry/sentry-go"
"github.com/labstack/echo/v4"
"golang.org/x/exp/slog"
)

func RunnerHTTPErrorHandler(err error, c echo.Context) {
switch typedErr := err.(type) {
case *httperror.Error:
slog.Error("http error", slog.Any("err", typedErr.Unwrap()))
sentry.CaptureException(err)
_ = c.JSON(typedErr.Code, typedErr)
case *echo.HTTPError:
Expand Down

0 comments on commit e835348

Please sign in to comment.