Skip to content

Error handing#2

Open
lexiwooood wants to merge 1 commit into
mainfrom
lexi
Open

Error handing#2
lexiwooood wants to merge 1 commit into
mainfrom
lexi

Conversation

@lexiwooood

Copy link
Copy Markdown
Collaborator

No description provided.

@davidjtgrant

Copy link
Copy Markdown

Error Handling looks good. Only suggestion would be to handle the scenario if "getHistoricalEthPrice()" doesn't return a valid value. If we don't get a number, this might cause a division issue when calculating the "rate". I also noticed two small issues in the rate calculations. I'll open an issue for them.

Comment thread api/app/main.py
try:
earliestDateString = str(earliestNFTInWalletTimeStamp.date().strftime("%d-%m-%Y"))
except:
print("An exception occurred while trying to get earliestNFTInWalletTimeStamp")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can also print the value of the earliestNFTInWalletTimeStamp variable. It can look like this I think

print(f'An exception occurred while trying to get earliestNFTInWalletTimeStamp, got {earliestNFTInWalletTimeStamp}')

Comment thread api/app/main.py
currentEthPriceResponse = getCurrentEthPrice()
currentEthPrice = float(currentEthPriceResponse['result']['ethusd'])
except:
print("An exception occurred while trying to get the currrent eth price")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with the previous comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants