From 03d5e87c37872f2dd03022eeb989f100993d126c Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 20 Mar 2020 22:26:43 +0100 Subject: [PATCH] wrap json parser into dedicated error : ErrInvalidJSON --- internal/reqdata/set.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/reqdata/set.go b/internal/reqdata/set.go index f595c14..b56a898 100644 --- a/internal/reqdata/set.go +++ b/internal/reqdata/set.go @@ -144,7 +144,7 @@ func (i *Set) parseJSON(req *http.Request) error { if err == io.EOF { return nil } - return err + return fmt.Errorf("%s: %w", err, ErrInvalidJSON) } for name, param := range i.service.Form {