Show a valid error when Internet is off-line while initializing a new project // Resolve #1784

This commit is contained in:
Ivan Kravets committed 2018-10-12 22:30:28 +03:00
1 parent 69d01c4bc1
commit 6294580e25
3 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -178,7 +178,7 @@ class InternetIsOffline(PlatformioException):
MESSAGE = (
"You are not connected to the Internet.\n"
"If you build a project first time, we need Internet connection "
"to install all dependencies and toolchain.")
"to install all dependencies and toolchains.")
class LibNotFound(PlatformioException):
+1
View File
@@ -414,6 +414,7 @@ class PkgInstallerMixin(object):
click.secho("Looking for another mirror...", fg="yellow")
if versions is None:
util.internet_on(raise_exception=True)
raise exception.UnknownPackage(name)
elif not pkgdata:
raise exception.UndefinedPackageVersion(requirements or "latest",