Avoid error if logFile is not defined
If there is an error initializing a plugin or checking the command-line arguments, we may use the logFile variable without having initialized it, which causes an exception. In those cases there will be no log file, so let's catch the exception and ignore it if it happens. Change-Id: Icaeb2ae780da9802591e9a063a71dd339b396b93 Closes-Bug: #1635770
This commit is contained in:
parent
8862c675c8
commit
6f6b5aa909
@ -1017,7 +1017,10 @@ def main():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(traceback.format_exc())
|
logging.error(traceback.format_exc())
|
||||||
print("\n" + utils.color_text("ERROR : " + str(e), 'red'))
|
print("\n" + utils.color_text("ERROR : " + str(e), 'red'))
|
||||||
|
try:
|
||||||
print(output_messages.ERR_CHECK_LOG_FILE_FOR_MORE_INFO % (logFile))
|
print(output_messages.ERR_CHECK_LOG_FILE_FOR_MORE_INFO % (logFile))
|
||||||
|
except NameError:
|
||||||
|
pass
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
Reference in New Issue
Block a user