Skip to content

Commit 6d19288

Browse files
author
Juliya Smith
committed
better error handlin
1 parent 7b40596 commit 6d19288

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

c42seceventcli/aed/args.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ def verify_username_arg(self):
119119

120120
def verify_destination_args(self):
121121
self.destination_type = self.destination_type.lower()
122-
self.destination_port = int(self.destination_port)
122+
try:
123+
self.destination_port = int(self.destination_port)
124+
except ValueError:
125+
msg = ("Destination port '{0}' not a base 10 integer.".format(self.destination_port))
126+
self._raise_value_error(msg)
123127
if self.destination_type == "stdout" and self.destination is not None:
124128
msg = (
125129
"Destination '{0}' not applicable for stdout. "

0 commit comments

Comments
 (0)