return an empty list upon exception #1

Merged
williamp merged 1 commits from empty-list into master 2024-03-20 14:17:10 +00:00
Showing only changes of commit ca00892fb5 - Show all commits

View File

@@ -77,7 +77,7 @@ class AnimalShelter(object):
return dataList # Return the list
except Exception as e:
print(f'Exception: {e}') # Exception handling
return False # Failed operation, so return false
return [] # Return empty list
# Update
def update(self, **kwargs):
"""
@@ -116,4 +116,4 @@ class AnimalShelter(object):
return True # Operation was successful, so return true
except Exception as e:
print(f'Exception: {e}') # Exception handling
return False # Failed operation, so return false
return False # Failed operation, so return false