xanzy / go-gitlab

GitLab Go SDK
Apache License 2.0
2.37k stars 940 forks source link

`GetGroup` error response type #1973

Closed ssteinhauser closed 1 month ago

ssteinhauser commented 1 month ago

Since version 0.106.0, the Groups.GetGroup method does not return the type gitlab.ErrorResponse anymore in case no group can be found. Instead it's just a simple errorString.

svanharmelen commented 1 month ago

I think you are seeing the effects of this change: https://github.com/xanzy/go-gitlab/compare/v0.105.0...v0.106.0#diff-044b5a63fdba539bf87d25040d91912aec34173e76af7b9e0f40d14da57edebeR979

If that is correct, it doesn't return a string but a typed error which allows you to check for this specific error (e.g. errors.Is(err, gitlab.ErrNotFound)) without having to parse the error message itself.

ssteinhauser commented 1 month ago

This fixed my issue, thank you very much 👍