Skip to content

Commit

Permalink
Items stored as numbers and exception handeling for Value Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Daniel Bennett committed Oct 19, 2020
1 parent 1b734b7 commit b783497
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/ECNQueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ class Item:

def __init__(self, queue: str, number: int) -> None:
self.queue = queue
self.number = number
try:
self.number = int(number)
except ValueError:
raise ValueError("Could not convert \"" + number + "\" to an integer")
#self.number = number

self.__path = "/".join([queueDirectory, self.queue, str(self.number)])
self.lastUpdated = self.__getLastUpdated()
Expand Down

0 comments on commit b783497

Please sign in to comment.