Automatically fall back to create
when edit
fails for endpoints that support it
#3378
Open
2 tasks done
Labels
type:feature
Changes add a new feature
Description
When using ProjectPushRules.edit() I discovered that, when nothing is originally set, GitLab will deny the edit with a 404 message.
There are two solutions:
ProjectPushRules.show()
to see if there is something there in the first place and choose which to call based on that (2 API calls)ProjectPushRules.edit()
, catch the error, and fall back onProjectPushRules.create()
with the exact same options.Proposal
Given that
edit()
andcreate()
have the exact same inputs, I would like to propose automatically falling back when possible so that the expected result occurs without the user needing to code around the edge cases.Checklist
The text was updated successfully, but these errors were encountered: