Skip to content

Commit

Permalink
Include user input in unit parsing error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
formatc1702 committed Nov 16, 2020
1 parent 694f3a3 commit 1d29c6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wireviz/DataClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def __post_init__(self) -> None:
try:
g, u = self.gauge.split(' ')
except Exception:
raise Exception('Gauge must be a number, or number and unit separated by a space')
raise Exception(f'{self.gauge} - Gauge must be a number, or number and unit separated by a space')
self.gauge = g

if u.upper() == 'AWG':
Expand All @@ -219,7 +219,7 @@ def __post_init__(self) -> None:
l, u = self.length.split(' ')
l = float(l)
except Exception:
raise Exception('Length must be a number, or number and unit separated by a space')
raise Exception(f'{self.length} - Length must be a number, or number and unit separated by a space')
self.length = l
self.length_unit = u
elif self.length is not None: # length specified, assume m
Expand Down

0 comments on commit 1d29c6c

Please sign in to comment.