Skip to content

Commit

Permalink
hack/cluster/cluster.go: Unpack OData errors
Browse files Browse the repository at this point in the history
MS Graph's APIError message says nothing useful.

See discussion in:
microsoftgraph/msgraph-sdk-go#110
  • Loading branch information
mbarnes committed Apr 15, 2022
1 parent 1525d4f commit 8e178b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hack/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"strings"
"time"

"github.com/davecgh/go-spew/spew"
msgraph_errors "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors"
"github.com/sirupsen/logrus"

"github.com/Azure/ARO-RP/pkg/env"
Expand Down Expand Up @@ -63,6 +65,9 @@ func main() {
rand.Seed(time.Now().UnixNano())

if err := run(context.Background(), log); err != nil {
if oDataError, ok := err.(msgraph_errors.ODataErrorable); ok {
spew.Dump(oDataError.GetError())
}
log.Fatal(err)
}
}

0 comments on commit 8e178b7

Please sign in to comment.