Use new error.As method
This commit is contained in:
parent
92642f4d53
commit
9b5f7a8148
1 changed files with 3 additions and 4 deletions
|
|
@ -269,12 +269,11 @@ func prView(cmd *cobra.Command, args []string) error {
|
|||
} else {
|
||||
pr, err := api.PullRequestForBranch(apiClient, baseRepo, branchWithOwner)
|
||||
if err != nil {
|
||||
switch err.(type) {
|
||||
case *api.NotFoundError:
|
||||
var notFoundErr *api.NotFoundError
|
||||
if errors.As(err, ¬FoundErr) {
|
||||
return fmt.Errorf("%s. To open a specific pull request use the pull request's number as an argument", err)
|
||||
default:
|
||||
return err
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
openURL = pr.URL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue