aboutsummaryrefslogtreecommitdiff
path: root/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'util.go')
-rw-r--r--util.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/util.go b/util.go
index ac3e3e4..1f5c0e3 100644
--- a/util.go
+++ b/util.go
@@ -27,9 +27,10 @@ func ujson(data string, output any) Error {
type Error struct {
Reason string `json:"error"`
- Error string `json:"errorDescription"`
- RAW []byte `json:"-"`
+ Error string `json:"errorDescription"`
+ RAW []byte `json:"-"`
}
+
func APIError(inputError error) (err Error) {
if inputError != nil {
err.RAW = []byte(inputError.Error())
@@ -94,11 +95,11 @@ func request(uri string, other ...string) reqrt {
r.Err = e
return r
}
- defer func() {
- if err := resp.Body.Close(); err != nil {
- try(err)
- }
- }()
+ defer func() {
+ if err := resp.Body.Close(); err != nil {
+ try(err)
+ }
+ }()
body, e := io.ReadAll(resp.Body)
if e != nil {