uniform
Build and Publish / BuildAndDeployArm64 (push) Failing after 7s
Build and Publish / BuildAndDeployAmd64 (push) Failing after 7s

This commit is contained in:
2026-07-20 00:13:24 +02:00
parent 83ed477aa4
commit e6f69f500a
14 changed files with 457 additions and 471 deletions
+9 -5
View File
@@ -1,6 +1,7 @@
package main
import (
"bytes"
"context"
"encoding/json"
"fmt"
@@ -60,12 +61,15 @@ func (k *KlarnaClient) getOrderResponse(res *http.Response) (*CheckoutOrder, err
}
return &klarnaOrderResponse, nil
}
body, err := io.ReadAll(res.Body)
if err == nil {
log.Println(string(body))
body, readErr := io.ReadAll(res.Body)
if len(body) > 0 {
log.Printf("klarna error body: %s", string(body))
return nil, fmt.Errorf("klarna: %s: %s", res.Status, string(bytes.TrimSpace(body)))
}
return nil, fmt.Errorf("%s", res.Status)
if readErr != nil {
return nil, fmt.Errorf("klarna: %s (body unreadable: %v)", res.Status, readErr)
}
return nil, fmt.Errorf("klarna: %s", res.Status)
}
func (k *KlarnaClient) CreateOrder(ctx context.Context, reader io.Reader) (*CheckoutOrder, error) {