Skip to content

Commit

Permalink
Add more informative error message when passed primitive not found
Browse files Browse the repository at this point in the history
  • Loading branch information
DBerke committed Nov 18, 2022
1 parent a25f0ef commit 126541a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gempy/scripts/showpars.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ def get_pars(filename, adpkg=None, drpkg=None):


def showpars(pobj, primname, tags, show_docstring):
print(f"Dataset tagged as {tags}")
print(f"\nSettable parameters on '{primname}':")
print(f"Dataset tagged as {tags}\n")
if primname not in pobj.params:
raise KeyError(f"{primname} doesn't exist for "
"this data type.")

print(f"Settable parameters on '{primname}':")
print("=" * 40)
print(f"{'Name':20s} {'Current setting':20s} Description\n")

Expand Down

0 comments on commit 126541a

Please sign in to comment.