Skip to content

Improve B00_www_browser error reporting #4

Open
@leviroth

Description

@leviroth

I tried using odig doc from WSL and got some confusing error messages:

$ odig doc base --browser="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome"
odig: [ERROR] show uri file:///home/leviroth/.opam/4.11.1/var/cache/odig/html/base/index.html: No browser found. Use the BROWSER env var to set one.
$ BROWSER="/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome" odig doc base
odig: [ERROR] show uri file:///home/leviroth/.opam/4.11.1/var/cache/odig/html/base/index.html: No browser found. Use the BROWSER env var to set one.

WSL is a weird environment, so I'm not too surprised that odig wouldn't work. (Notably, odig is running on a Linux environment that lives inside a Windows environment, and has to reach back out into the Windows environment to find the browser.) However, I am surprised that the error message suggests that the BROWSER environment variable isn't set.

I poked around in the source a bit and, while I'm not sure I understood all of it, it seems like B00_www_browser.show ~background ~prefix browser uri always complains about a missing environment variable when browser is None, while in reality B00_www_browser.find might be giving us None for various other reasons.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions