chore(http): update error handling example in readme (#13874)

pull/13901/head
Jade McGough 2019-05-13 12:50:25 -07:00 committed by GitHub
parent 184ed7120e
commit 29d2387752
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -69,13 +69,13 @@ func (h *ThingHandler) handlePostThing(w http.ResponseWriter, r *http.Request) {
req, err := decodePostThingRequest(ctx, r)
if err != nil {
errors.EncodeHTTP(ctx, err, w)
EncodeError(ctx, err, w)
return
}
// Do stuff here
if err := h.ThingService.CreateThing(ctx, req.Thing); err != nil {
errors.EncodeHTTP(ctx, err, w)
EncodeError(ctx, err, w)
return
}