Using v1 Update Organization endpoint in Go SDK and handling errors
I'm trying to use the endpoint as defined here: https://zitadel.com/docs/apis/resources/mgmt/management-service-update-org
Relevant handler is:
https://github.com/zitadel/zitadel-go/blob/2667335f79f6b437a29b19c0184f6e243beee52e/pkg/client/zitadel/management/management_grpc.pb.go#L1285-L1292
I want to make this call idempotent - that is to say, I want to run this to upsert the name, so if it's the same it stays the same, if it's not, it amends it.
Right now it errors if the update of the org name is the same as the current name but I don't want to just catch all the err as an upsert error in case it genuinely didn't work.
So my question is: how can I differentiate between a failure and the name being the same as it currently is and the change isn't enacted.
Is there an errors.Is() type I can check against to be sure in my client code?
Relevant handler is:
https://github.com/zitadel/zitadel-go/blob/2667335f79f6b437a29b19c0184f6e243beee52e/pkg/client/zitadel/management/management_grpc.pb.go#L1285-L1292
I want to make this call idempotent - that is to say, I want to run this to upsert the name, so if it's the same it stays the same, if it's not, it amends it.
Right now it errors if the update of the org name is the same as the current name but I don't want to just catch all the err as an upsert error in case it genuinely didn't work.
So my question is: how can I differentiate between a failure and the name being the same as it currently is and the change isn't enacted.
Is there an errors.Is() type I can check against to be sure in my client code?
GitHub
ZITADEL Go - The official client library of ZITADEL for an easy integration into your Go project. - zitadel/zitadel-go

