Question: Application Crashes on list Command You can observe this bug by starting the application using the example code in the main execution loop of the

Application Crashes on list Command
You can observe this bug by starting the application using the example code in the main execution loop of the app.py file.
python app.py
Once, the application is up and running, you simply need to repeatedly invoke the list command, e.g.:
What would you like to do? l
Shopping list with 2 items has been created.
What would you like to do? l
Shopping list with 3 items has been created.
What would you like to do? l
Traceback (most recent call last):
File "...\shopping-app-prototype-2\original\app.py", line 137, in
app.run()
File "...\shopping-app-prototype-2\original\app.py", line 40, in run
self.execute_command(cmd)
File "...\shopping-app-prototype-2\original\app.py", line 56, in execute_command
self.shopping_list.refresh(item_pool=self.items)
File "...\shopping-app-prototype-2\original\shoppinglist.py", line 17, in refresh
raise InvalidShoppingListSizeError()
errors.InvalidShoppingListSizeError: Invalid List Size!
Your task is to figure out what is the cause of this occasional error and fix the application so that it works as expected. Note that you are not allowed to modify the intended behavior of the application. You need to understand why and when the error happens and make the change to the code so that the application no longer crashes upon the invocation of the list command. However, any changes in excess to that will result in you obtaining the score of 0 even if the error no longer occurs.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!