Skip to content

Commit

Permalink
Remove deferred function from handle function
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuntao Lu committed Jul 2, 2019
1 parent 05ca1a7 commit 133a174
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions runtime/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ func NewHTTPRouter(gateway *Gateway) HTTPRouter {

// Register register a handler function.
func (router *httpRouter) Handle(method, prefix string, handler http.Handler) (err error) {
defer func() {
recoveredValue := recover()
if recoveredValue != nil {
err = fmt.Errorf("caught error when registering %s %s: %+v", method, prefix, recoveredValue)
}
}()

h := func(w http.ResponseWriter, r *http.Request) {
reqUUID := r.Header.Get(router.requestUUIDHeaderKey)
if reqUUID == "" {
Expand Down

0 comments on commit 133a174

Please sign in to comment.