commit f72a152760e912cd8c21ced335ad17fdea05a4e9 Author: David Fifield david@bamsoftware.com Date: Sat Mar 30 13:10:33 2019 -0600
These can be ordinary error returns, not panics. --- webextension/native/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/webextension/native/main.go b/webextension/native/main.go index 8771b72..44e2d82 100644 --- a/webextension/native/main.go +++ b/webextension/native/main.go @@ -127,7 +127,7 @@ func recvRequestSpec(r io.Reader) (requestSpec, error) { func sendResponseSpec(w io.Writer, spec responseSpec) error { encodedSpec, err := json.Marshal(spec) if err != nil { - panic(err) + return err } // len returns int, which is specified to be either 32 or 64 bits, so it // will never be truncated when converting to uint64. @@ -211,7 +211,7 @@ func roundTrip(req requestSpec, outToBrowserChan chan<- []byte) (responseSpec, e Request: req, }) if err != nil { - panic(err) + return nil, err } outToBrowserChan <- message
tor-commits@lists.torproject.org