elm-lang/elm-platform

Add --offline switch to allow tools to work when disconnected

tpoindex opened this issue · 2 comments

elm-make, elm-repl, and elm-reactor all depend on accessing http://package.elm-lang.org to check for newer packages than already cached. When off network, these tools fail while trying to access the package repo:

$ echo 1 | elm-repl
---- elm-repl 0.18.0 -----------------------------------------------------------
 :help for help, :exit to exit, more at <https://github.com/elm-lang/elm-repl>
--------------------------------------------------------------------------------
> Error: The following HTTP request failed.
<http://package.elm-lang.org/all-packages?elm-package-version=0.18&since=2017-07-28%2020%3A06%3A57.85016%20UTC>
 "

FailedConnectionException2 "package.elm-lang.org" 80 False getAddrInfo: does not exist (nodename nor servname provided, or not known)

Provide an "--offline" command line switch that prevents the tools from accessing the network. I believe this code is actually in the elm-package repo, but does affect all tools.

Or allow HTTP requests to fail with a warning, but not terminate the elm tool.

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

We are planning to support offline work better in the next release. We are doing it a different way, but I think it'll address your concerns. I will close, and we can revisit after 0.19 if there are any troubles.