Skip to content

Commit

Permalink
Improve error handling on non-existent coupons
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed Sep 10, 2019
1 parent 23b821f commit b50a3c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/coupons.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (a *API) lookupCoupon(ctx context.Context, w http.ResponseWriter, code stri
coupon, err := couponCache.Lookup(code)
if err != nil {
switch v := err.(type) {
case coupons.CouponNotFound:
case *coupons.CouponNotFound:
return nil, notFoundError(v.Error())
default:
return nil, internalServerError("Error fetching coupon").WithInternalError(err)
Expand Down

0 comments on commit b50a3c1

Please sign in to comment.