Skip to content

Commit

Permalink
improve exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushjariyal committed Feb 14, 2025
1 parent ccb9d2a commit a9e7df5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/aiida/orm/nodes/data/array/xy.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ def get_y_arraynames(self) -> list[str]:
"""Returns the user-provided names of the y-arrays."""

try:
return self.base.attributes.get('y_names')
y_names = self.base.attributes.get('y_names')
if y_names is None:
raise KeyError
except (KeyError, AttributeError):
raise NotExistent(f'No y names been set yet')
raise NotExistent(f'No y names been set yet!')

0 comments on commit a9e7df5

Please sign in to comment.