Skip to content

Commit 328f16f

Browse files
author
brianmc
committed
Added exception handling for property file missing
1 parent 552a217 commit 328f16f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

authorizenet/utility.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ def getproperty(propertyname):
4545

4646
stringvalue = "null"
4747
if ("null" != helper.getparser()):
48-
stringvalue = helper.getparser().get("properties", propertyname)
48+
try:
49+
stringvalue = helper.getparser().get("properties", propertyname)
50+
except NoSectionError as nse:
51+
print (" properties section does not exist, will read from environment")
52+
stringvalue = os.getenv[propertyname]
53+
4954
else :
5055
print (" property file does not exist, will read from environment")
5156
stringvalue = os.getenv[propertyname]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy