Skip to content

Commit 09c1f23

Browse files
committed
small refactor to jplspec to handle error messages better and be
symmetric with CDMS
1 parent b7f2553 commit 09c1f23

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

astroquery/jplspec/core.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def query_lines_async(self, min_frequency, max_frequency,
104104
if molecule is not None:
105105
if parse_name_locally:
106106
self.lookup_ids = build_lookup()
107-
payload['Mol'] = tuple(self.lookup_ids.find(molecule, flags))
107+
payload['Mol'] = tuple(self.lookup_ids.find(molecule, flags).values())
108108
if len(molecule) == 0:
109109
raise ValueError('No matching species found. Please\
110110
refine your search or read the Docs\
@@ -156,6 +156,9 @@ def _parse_result(self, response, verbose=False):
156156
QN": Quantum numbers for the lower state.
157157
"""
158158

159+
if 'Zero lines were found' in response.text:
160+
raise ValueError(f"Response was empty; message was '{response.text}'.")
161+
159162
# data starts at 0 since regex was applied
160163
# Warning for a result with more than 1000 lines:
161164
# THIS form is currently limited to 1000 lines.

astroquery/jplspec/lookup_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ def find(self, s, flags):
3535
if match:
3636
out[k] = v
3737

38-
return out.values()
38+
return out

0 commit comments

Comments
 (0)