Skip to content

Commit

Permalink
Merge pull request #38 from BlockchainCommons/watersnake1-patch-4
Browse files Browse the repository at this point in the history
Catch error when ONION variable isn't present in PATH
  • Loading branch information
ChristopherA authored Oct 10, 2020
2 parents 061c1cc + bb6a693 commit ad057eb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@
db = sqlite3.connect(p)
print(f"db opened in {p}")
log.debug(f"db opened in {p}")
ONION = os.environ["ONION"] #get this value from the path
print(f"spotbit is running at {ONION}")

ONION = ""
try:
ONION = os.environ["ONION"] #get this value from the path
print(f"spotbit is running at {ONION}")
except Exception as e:
print(f"cant find ONION in PATH {e}")

# Database configuration
# We need to have the database opened manually once so that systemd can access it
def configure_db():
Expand Down

0 comments on commit ad057eb

Please sign in to comment.