Skip to content

Commit c649cc8

Browse files
committed
Fix error message for CyclicIncludeErrors
1 parent a4eab05 commit c649cc8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/minizinc/error.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,15 @@ def error_from_stream_obj(obj):
193193
(obj["location"]["firstLine"], obj["location"]["lastLine"]),
194194
(obj["location"]["firstColumn"], obj["location"]["lastColumn"]),
195195
)
196-
197196
# TODO: Process stack information
198197

199-
return error(location, obj["message"])
198+
message = (
199+
"MiniZinc stopped with a non-zero exit code, but did not output an "
200+
"error message. "
201+
)
202+
if "message" in obj:
203+
message = obj["message"]
204+
elif "cycle" in obj:
205+
message = " includes ".join(obj["cycle"])
206+
207+
return error(location, message)

0 commit comments

Comments
 (0)