Skip to content

Commit b50a3c1

Browse files
committed
Improve error handling on non-existent coupons
1 parent 23b821f commit b50a3c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/coupons.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func (a *API) lookupCoupon(ctx context.Context, w http.ResponseWriter, code stri
2020
coupon, err := couponCache.Lookup(code)
2121
if err != nil {
2222
switch v := err.(type) {
23-
case coupons.CouponNotFound:
23+
case *coupons.CouponNotFound:
2424
return nil, notFoundError(v.Error())
2525
default:
2626
return nil, internalServerError("Error fetching coupon").WithInternalError(err)

0 commit comments

Comments
 (0)