Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

notary_http - raise ValueError instead of adapting

It's better to let the user know something is wrong
  • Loading branch information...
commit 50b48eb81287443e3e68fcb4d97b2160a23a4ae2 1 parent 660f5c4
@daveschaefer daveschaefer authored
View
1  AUTHORS
@@ -6,4 +6,5 @@ With many thanks to the following contributors:
Kyle Anderson
Dinesh Israni
Dave Schaefer
+mwgamera
Von Welch
View
4 notary_http.py
@@ -91,8 +91,8 @@ def __init__(self):
if (self.ENV_PORT_KEY_NAME in os.environ):
self.web_port = int(os.environ[self.ENV_PORT_KEY_NAME])
else:
- print >> sys.stderr, "ERROR: envport option specified but no '%s' variable exists. Falling back to port %s." % \
- (self.ENV_PORT_KEY_NAME, self.web_port)
+ raise ValueError("--envport option specified but no '%s' variable exists." % \
+ (self.ENV_PORT_KEY_NAME))
elif (args.webport):
self.web_port = args.webport
View
2  test/Network Notary Test Cases.txt
@@ -18,7 +18,7 @@ Arguments
- If neither is specifed do we use the default port?
- If webport is specefied but is not an integer, does argparse reject it?
- If webport is specified and is an integer, and no envport is given, do we use the webport?
- - If envport is specified but no environment variable by that name exists, do we log a warning and fall back to the default?
+ - If envport is specified but no environment variable by that name exists, do we throw a ValueError?
- If envport is specified and the env var exists but is not an integer, do we throw a ValueError?
- If envport is specified and the env var exists and is a valid integer, do we use it?
- If both are specified, does argparse reject that usage?
Please sign in to comment.
Something went wrong with that request. Please try again.