Improve error message in branch existence check#6148
Conversation
There was a problem hiding this comment.
Pull request overview
Updates DARC’s set-repository-policies operation to perform an explicit branch existence check via IRemote.BranchExistsAsync, aiming to produce clearer failures when branch verification can’t be performed.
Changes:
- Replaced
UxHelpers.VerifyAndConfirmBranchExistsAsync(...)with a directBranchExistsAsynccall. - Added exception handling and logging around the branch existence verification path.
…liciesOperation.cs
premun
left a comment
There was a problem hiding this comment.
@adamzip should we still narrow down the exception we're catching? Seems like we might be masking other problems - like if GitHub 500s the user will think it's a PAT problem and will go and regenerate it only to find out it didn't help anything
I wanted to avoid parsing the error message of the |
|
That's maybe a better error message but do we need to parse the error message?
|
I implemented your suggestion, feel free to change the message wording |
#6141