From 73e6220a8cef5ad6d44e3d138ecf332c9f879478 Mon Sep 17 00:00:00 2001 From: Alfred Kamanda Date: Tue, 21 Oct 2025 15:02:36 +0300 Subject: [PATCH] create a custom error struct that carries both fields from the API --- remote/http/service.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/remote/http/service.go b/remote/http/service.go index c17b0d1..4286997 100644 --- a/remote/http/service.go +++ b/remote/http/service.go @@ -27,6 +27,15 @@ var ( logg = logging.NewVanilla().WithDomain("sarafu-api.devapi") ) +type APIError struct { + Code string + Description string +} + +func (e *APIError) Error() string { + return e.Description +} + type HTTPAccountService struct { SS storage.StorageService UseApi bool