Skip to content

Commit

Permalink
ENH: Updating plotting and error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamTheisen committed Nov 21, 2024
1 parent fc65451 commit 1ae0a39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion act/discovery/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ def download_arm_data(username, token, datastream, startdate, enddate, time=None

# get url response, read the body of the message,
# and decode from bytes type to utf-8 string
response_body = urlopen(query_url).read().decode('utf-8')
try:
response_body = urlopen(query_url).read().decode('utf-8')
except Exception as error:
print(error + ' for url: ' + query_url)
# if the response is an html doc, then there was an error with the user
if response_body[1:14] == '!DOCTYPE html':
raise ConnectionRefusedError('Error with user. Check username or token.')
Expand Down
2 changes: 2 additions & 0 deletions examples/workflows/plot_amf3_comparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,5 @@
ax.legend(loc=2)

plt.show()
else:
pass

0 comments on commit 1ae0a39

Please sign in to comment.