Skip to content

Commit 9cebd7c

Browse files
committedSep 30, 2020
better service error handling addresses #23
1 parent 70b7083 commit 9cebd7c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎otohttp/templates/server.go.plush

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ func (s *<%= camelize_down(service.Name) %>Server) handle<%= method.Name %>(w ht
4343
}
4444
response, err := s.<%= camelize_down(service.Name) %>.<%= method.Name %>(r.Context(), request)
4545
if err != nil {
46-
log.Println("TODO: oto service error:", err)
47-
http.Error(w, err.Error(), http.StatusInternalServerError)
46+
s.server.OnErr(w, r, err)
4847
return
4948
}
5049
if err := otohttp.Encode(w, r, http.StatusOK, response); err != nil {

0 commit comments

Comments
 (0)
Please sign in to comment.