Skip to content

Commit

Permalink
Merge pull request #324 from ocefpaf/avoid_bad_servers
Browse files Browse the repository at this point in the history
drop bad servers in multiple servers search
  • Loading branch information
ocefpaf authored Nov 6, 2023
2 parents a496058 + 977bb49 commit fbb2724
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion erddapy/multiple_server_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ def fetch_results(
if data is None:
return None
else:
df = pd.read_csv(data)
try:
df = pd.read_csv(data)
except pd.errors.ParserError:
# bad servers will return data that is not a csv but with valid html code :-/
return None
try:
df.dropna(subset=[protocol], inplace=True)
except KeyError:
Expand Down

0 comments on commit fbb2724

Please sign in to comment.