11//
22// DISCLAIMER
33//
4- // Copyright 2018 ArangoDB GmbH, Cologne, Germany
4+ // Copyright 2018-2025 ArangoDB GmbH, Cologne, Germany
55//
66// Licensed under the Apache License, Version 2.0 (the "License");
77// you may not use this file except in compliance with the License.
1717//
1818// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919//
20- // Author Ewout Prangsma
21- //
2220
2321package agency
2422
2523import (
2624 "context"
25+ "errors"
2726 "fmt"
2827 "sync"
2928 "time"
@@ -69,7 +68,7 @@ func (c *agencyConnection) NewRequest(method, path string) (driver.Request, erro
6968 defer c .mutex .RUnlock ()
7069
7170 if len (c .connections ) == 0 {
72- return nil , driver .WithStack (fmt . Errorf ("no connections" ))
71+ return nil , driver .WithStack (errors . New ("no connections" ))
7372 }
7473 r , err := c .connections [0 ].NewRequest (method , path )
7574 if err != nil {
@@ -132,7 +131,7 @@ func (c *agencyConnection) doOnce(ctx context.Context, req driver.Request) (driv
132131 c .mutex .RUnlock ()
133132
134133 if len (c .connections ) == 0 {
135- return nil , true , driver .WithStack (fmt . Errorf ("no connections" ))
134+ return nil , true , driver .WithStack (errors . New ("no connections" ))
136135 }
137136
138137 parallelRequests := true
@@ -208,7 +207,7 @@ func (c *agencyConnection) doOnce(ctx context.Context, req driver.Request) (driv
208207
209208func isSuccess (resp driver.Response ) error {
210209 if resp == nil {
211- return driver .WithStack (fmt . Errorf ("Response is nil" ))
210+ return driver .WithStack (errors . New ("Response is nil" ))
212211 }
213212 statusCode := resp .StatusCode ()
214213 if statusCode >= 200 && statusCode < 300 {
@@ -235,7 +234,7 @@ func (c *agencyConnection) Unmarshal(data driver.RawObject, result interface{})
235234 defer c .mutex .RUnlock ()
236235
237236 if len (c .connections ) == 0 {
238- return driver .WithStack (fmt . Errorf ("no connections" ))
237+ return driver .WithStack (errors . New ("no connections" ))
239238 }
240239 if err := c .connections [0 ].Unmarshal (data , result ); err != nil {
241240 return driver .WithStack (err )
0 commit comments