From 9c48251790bdc2ceeaba2325124ffa2844ea5216 Mon Sep 17 00:00:00 2001 From: Clement Liaw Date: Fri, 3 Jan 2025 10:15:04 -0800 Subject: [PATCH] wip: error debugging --- internal/common/util.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/common/util.go b/internal/common/util.go index 881a6d5..850d5d8 100644 --- a/internal/common/util.go +++ b/internal/common/util.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "k8s.io/klog/v2" "math" "net/http" "strings" @@ -130,10 +131,12 @@ func GetAsyncOperationResult[T any](ctx context.Context, op *crusoeapi.Operation // additional information which is present in the response. The error // is returned unchanged if it cannot be unpacked. func UnpackSwaggerErr(original error) error { + klog.Infof("original error: %s", original) swagErr := &crusoeapi.GenericSwaggerError{} if ok := errors.As(original, swagErr); !ok { return original } + klog.Infof("swagger error: %s", swagErr.Error()) var model crusoeapi.ErrorBody err := json.Unmarshal(swagErr.Body(), &model)