mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
tools: Warning about tool beiing installed but failed to run.
idf_tool.py runs "<tool> --version" which returns the error message but it is not used This improves the error printing.
This commit is contained in:
parent
9a6f507091
commit
ebbe25ec73
@ -466,8 +466,8 @@ class IDFTool(object):
|
|||||||
# tool is not on the path
|
# tool is not on the path
|
||||||
raise ToolNotFound('Tool {} not found'.format(self.name))
|
raise ToolNotFound('Tool {} not found'.format(self.name))
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
raise ToolExecError('Command {} has returned non-zero exit code ({})\n'.format(
|
raise ToolExecError('returned non-zero exit code ({}) with error message:\n{}'.format(
|
||||||
' '.join(self._current_options.version_cmd), e.returncode))
|
e.returncode, e.stderr.decode('utf-8',errors='ignore'))) # type: ignore
|
||||||
|
|
||||||
in_str = version_cmd_result.decode("utf-8")
|
in_str = version_cmd_result.decode("utf-8")
|
||||||
match = re.search(self._current_options.version_regex, in_str)
|
match = re.search(self._current_options.version_regex, in_str)
|
||||||
@ -512,8 +512,9 @@ class IDFTool(object):
|
|||||||
except ToolNotFound:
|
except ToolNotFound:
|
||||||
# not in PATH
|
# not in PATH
|
||||||
pass
|
pass
|
||||||
except ToolExecError:
|
except ToolExecError as e:
|
||||||
warn('tool {} found in path, but failed to run'.format(self.name))
|
warn('tool {} found in path, but {}'.format(
|
||||||
|
self.name, e))
|
||||||
else:
|
else:
|
||||||
self.version_in_path = ver_str
|
self.version_in_path = ver_str
|
||||||
|
|
||||||
@ -531,9 +532,9 @@ class IDFTool(object):
|
|||||||
except ToolNotFound:
|
except ToolNotFound:
|
||||||
warn('directory for tool {} version {} is present, but tool was not found'.format(
|
warn('directory for tool {} version {} is present, but tool was not found'.format(
|
||||||
self.name, version))
|
self.name, version))
|
||||||
except ToolExecError:
|
except ToolExecError as e:
|
||||||
warn('tool {} version {} is installed, but the tool failed to run'.format(
|
warn('tool {} version {} is installed, but {}'.format(
|
||||||
self.name, version))
|
self.name, version, e))
|
||||||
else:
|
else:
|
||||||
if ver_str != version:
|
if ver_str != version:
|
||||||
warn('tool {} version {} is installed, but has reported version {}'.format(
|
warn('tool {} version {} is installed, but has reported version {}'.format(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user