From ec3002e995d9977ba32f56e80c36ad1d1080bd7a Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Fri, 29 Jan 2021 12:51:25 +0100 Subject: [PATCH] add more details to errors --- pkg/base/content.go | 3 ++- pkg/base/header.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/base/content.go b/pkg/base/content.go index dd17fa4d..a9a4c717 100644 --- a/pkg/base/content.go +++ b/pkg/base/content.go @@ -22,7 +22,8 @@ func (c *payload) read(rb *bufio.Reader, header Header) error { } if cl > rtspMaxContentLength { - return fmt.Errorf("Content-Length exceeds %d", rtspMaxContentLength) + return fmt.Errorf("Content-Length exceeds %d (it's %d)", + rtspMaxContentLength, cl) } *c = make([]byte, cl) diff --git a/pkg/base/header.go b/pkg/base/header.go index 2b1309fc..f84f683d 100644 --- a/pkg/base/header.go +++ b/pkg/base/header.go @@ -53,7 +53,8 @@ func (h *Header) read(rb *bufio.Reader) error { } if len(*h) >= headerMaxEntryCount { - return fmt.Errorf("headers count exceeds %d", headerMaxEntryCount) + return fmt.Errorf("headers count exceeds %d (it's %d)", + headerMaxEntryCount, len(*h)) } key := string([]byte{byt})