bmwcarit / Emma

Emma Memory and Mapfile Analyser. (Repo marked private after security audit. Contact Marian Kneer for details)
GNU General Public License v3.0
4 stars 0 forks source link

Deltas: Check and handle input behaviour #45

Closed holzkohlengrill closed 3 years ago

holzkohlengrill commented 4 years ago

Description

Incorrect input data causes deltas to crash. For example:

        (info) : Started processing at 14:52:04
Enter project root path >C:\0-repos\Emma\MAdZ-configs\Project
    0: Section_Summary
    1: Object_Summary
    2: Objects_in_Sections
Choose File type >
0
Select two indices seperated by one space >0 0 
Traceback (most recent call last):
  File "C:/0-repos/Emma/Emma/emma_deltas.py", line 153, in <module>
    runEmmaDeltas()
  File "C:/0-repos/Emma/Emma/emma_deltas.py", line 149, in runEmmaDeltas
    main(parsedArguments)
  File "C:/0-repos/Emma/Emma/emma_deltas.py", line 127, in main
    candidates = filePresenter.chooseCandidates()
  File "C:\0-repos\Emma\Emma\emma_delta_libs\FilePresenter.py", line 55, in chooseCandidates
    indices: typing.List[int] = [int(i) for i in indices]
  File "C:\0-repos\Emma\Emma\emma_delta_libs\FilePresenter.py", line 55, in <listcomp>
    indices: typing.List[int] = [int(i) for i in indices]
ValueError: invalid literal for int() with base 10: ''

Process finished with exit code 1

If an invalid root path is entered deltas raises a FileNotFound error.

ToDo's

Consider also the expected behaviour in the attachment from #14 .