Skip to content

Commit

Permalink
Raise exception for invalid timeout values.
Browse files Browse the repository at this point in the history
  • Loading branch information
gareth-palmer committed May 7, 2024
1 parent ef72efe commit 2893fe9
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cgiexecute
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ def main():

try:
timeout = int(timeout)

if timeout < 1:
raise ValueError

except ValueError:
raise ProgramError(f'Invalid timeout: {timeout}')

Expand Down
4 changes: 4 additions & 0 deletions mediastream
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ def main():

try:
timeout = int(timeout)

if timeout < 1:
raise ValueError

except ValueError:
raise ProgramError(f'Invalid timeout: {timeout}')

Expand Down
4 changes: 4 additions & 0 deletions screenshot
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ def main():

try:
timeout = int(timeout)

if timeout < 1:
raise ValueError

except ValueError:
raise ProgramError(f'Invalid timeout: {timeout}')

Expand Down
4 changes: 4 additions & 0 deletions setbackground
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def main():

try:
timeout = int(timeout)

if timeout < 1:
raise ValueError

except ValueError:
raise ProgramError(f'Invalid timeout: {timeout}')

Expand Down
4 changes: 4 additions & 0 deletions setringtone
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def main():

try:
timeout = int(timeout)

if timeout < 1:
raise ValueError

except ValueError:
raise ProgramError(f'Invalid timeout: {timeout}')

Expand Down
4 changes: 4 additions & 0 deletions xmlinfo
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ def main():

try:
timeout = int(timeout)

if timeout < 1:
raise ValueError

except ValueError:
raise ProgramError(f'Invalid timeout: {timeout}')

Expand Down

0 comments on commit 2893fe9

Please sign in to comment.