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

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

View File

@ -19,6 +19,8 @@ PlatformIO 3.0
from a project
* Report about outdated `99-platformio-udev.rules <http://docs.platformio.org/page/faq.html#platformio-udev-rules>`__
(`issue #1823 <https://github.com/platformio/platformio-core/issues/1823>`_)
* Show a valid error when Internet is off-line while initializing a new project
(`issue #1784 <https://github.com/platformio/platformio-core/issues/1784>`_)
* Fixed an issue when dynamic build flags were not handled correctly
(`issue #1799 <https://github.com/platformio/platformio-core/issues/1799>`_)
* Fixed an issue when ``pio run -t monitor`` always uses first ``monitor_port``

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):

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",