Skip to content

Commit

Permalink
fix: Clear error message when option is missing
Browse files Browse the repository at this point in the history
Specifying a default obscures the fact that a required coordinate
option may be missing from the config. The result, when an option
is missing, is a cryptic error message (an unhandled exception).
All coordinate options are required, there is no need to specify
a default and handle the missing data elsewhere.

Signed-off-by: Alan Smith <[email protected]>
  • Loading branch information
cloakedcode committed Jun 13, 2023
1 parent c431e75 commit 82e3db7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion klippy/extras/dockable_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def __init__(self, config):
#
# e.g. "233, 10, 0" -> [233, 10, 0]
def _parse_coord(self, config, name, expected_dims=3):
val = config.get(name, None)
val = config.get(name)
error_msg = "Unable to parse {0} in {1}: {2}"
if not val:
return None
Expand Down

0 comments on commit 82e3db7

Please sign in to comment.