Skip to content

gh browse -n -R should error on 404 #7255

@ianwilliams1

Description

@ianwilliams1

Describe the bug

If a target repo does not exist, eg: gh browse -R cli/cli brings up a 404 in the browser, but gh browse -n -R cli/cli returns a destination URL that does not exist and exit status 0.

Steps to reproduce the behavior

$  gh browse -n -R cli/cli
https://github.com/cli/cli

$ echo $?
0

$  gh browse -n -R cli/cli-doesnotexist
https://github.com/cli/cli-doesnotexist

$ echo $?
0

Expected vs actual behavior

Expect to test if the constructed destination URL exist before displaying to the user, or at least provide a warning that it's not reachable.
gh browse -n -R ORG/REPO where ORG/REPO does not exist should return error message and non-zero exit code

Maybe 2 error codes - one if ORG reachable but REPO is not, one for ORG/REPO not reachable?

Logs

See steps to reproduce

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions