File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 "encoding/json"
55 "fmt"
66 "io"
7+ "strings"
78)
89
910// Error represents an error returned by the bunq API.
@@ -16,12 +17,12 @@ type Error struct {
1617type Errors []Error
1718
1819func (e Errors ) Error () string {
19- var errs []string
20- for i := range e {
21- errs = append ( errs , e [i ].ErrorDescription )
20+ errs := make ( []string , len ( e ))
21+ for i , err := range e {
22+ errs [i ] = err .ErrorDescription
2223 }
2324
24- return fmt . Sprintf ( "%v" , errs )
25+ return strings . Join ( errs , ", " )
2526}
2627
2728func decodeError (r io.Reader ) error {
@@ -33,7 +34,7 @@ func decodeError(r io.Reader) error {
3334 }
3435 err := json .NewDecoder (r ).Decode (& apiError )
3536 if err != nil {
36- return fmt .Errorf ("bunq: could not decode errors from json: %v" , err )
37+ return fmt .Errorf ("could not decode errors from json: %v" , err )
3738 }
3839
3940 var errors Errors
You can’t perform that action at this time.
0 commit comments