From ecb343b3b32b6a88f21328596b0cb19ade706335 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Sat, 14 Jan 2023 13:27:08 +0100 Subject: [PATCH] gps: improve error handling Signed-off-by: deadprogram --- gps/gps.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gps/gps.go b/gps/gps.go index 21bee2e..a53a446 100644 --- a/gps/gps.go +++ b/gps/gps.go @@ -38,6 +38,10 @@ func (ge GPSError) Error() string { return ge.Err.Error() + " " + ge.Info + " " + ge.Sentence } +func (ge GPSError) Unwrap() error { + return ge.Err +} + // Device wraps a connection to a GPS device. type Device struct { buffer []byte