Skip to content

Commit c2f96c9

Browse files
authored
Update error handling to return 404 for display issues
Change return value for error handling to 404 instead of None.
1 parent 4b10ddb commit c2f96c9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

StreamingCommunity/Util/table.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ def display_data(self, data_slice: List[Dict[str, Any]]) -> None:
9090
"""
9191
if not data_slice:
9292
logging.error("Nothing to display.")
93-
return
93+
return 404
9494

9595
if not self.column_info:
9696
logging.error("Error: Column information not configured.")
97-
return
97+
return 404
9898

9999
# Create table with specified style
100100
table = Table(
@@ -202,7 +202,9 @@ def run(self, force_int_input: bool = False, max_int_input: int = 0) -> str:
202202
self.slice_end = min(self.step, total_items)
203203
current_slice = self.tv_shows[self.slice_start:self.slice_end]
204204

205-
self.display_data(current_slice)
205+
result_func = self.display_data(current_slice)
206+
if result_func == 404:
207+
sys.exit(1)
206208

207209
# Get research function from call stack
208210
research_func = next((
@@ -300,4 +302,4 @@ def clear(self) -> None:
300302
"""
301303
self.tv_shows = []
302304
self.slice_start = 0
303-
self.slice_end = self.step
305+
self.slice_end = self.step

0 commit comments

Comments
 (0)