summaryrefslogtreecommitdiff
path: root/lib/stitches
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2019-04-09 23:49:54 -0400
committerLex Neva <github.com@lexneva.name>2019-04-09 23:49:54 -0400
commita766e4e40858cb7954c8c6ea4a1a9de8d31ee054 (patch)
tree7d9d7d5a908808bf99e9c7173c015c566b12bbca /lib/stitches
parent92541eb760eca6df14abca194e087be5183ffdfd (diff)
make error message more readable
Diffstat (limited to 'lib/stitches')
-rw-r--r--lib/stitches/auto_fill.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/stitches/auto_fill.py b/lib/stitches/auto_fill.py
index 7d231953..84f10d45 100644
--- a/lib/stitches/auto_fill.py
+++ b/lib/stitches/auto_fill.py
@@ -370,11 +370,13 @@ def build_travel_edges(shape, fill_angle):
def check_graph(graph, shape, max_stitch_length):
if networkx.is_empty(graph) or not networkx.is_eulerian(graph):
if shape.area < max_stitch_length ** 2:
- raise InvalidPath(_("This shape is so small that it cannot be filled with rows of stitches. "
- "It would probably look best as a satin column or running stitch."))
+ message = "This shape is so small that it cannot be filled with rows of stitches. " \
+ "It would probably look best as a satin column or running stitch."
+ raise InvalidPath(_(message))
else:
- raise InvalidPath(_("Cannot parse shape. "
- "This most often happens because your shape is made up of multiple sections that aren't connected."))
+ message = "Cannot parse shape. " \
+ "This most often happens because your shape is made up of multiple sections that aren't connected."
+ raise InvalidPath(_(message))
def nearest_node(nodes, point, attr=None):