Skip to content

Commit

Permalink
Merge pull request #224 from dlyongemallo/import_tikz_proof_err_msg
Browse files Browse the repository at this point in the history
Better error message when attempting to import proof from TikZ.
  • Loading branch information
RazinShaikh authored Dec 21, 2023
2 parents 6c4bdda + abd136e commit f0dafa3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zxlive/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ def import_diagram_from_file(file_path: str, selected_filter: str = FileFormat.A
elif selected_format == FileFormat.QASM:
return ImportGraphOutput(selected_format, file_path, Circuit.from_qasm(data).to_graph()) # type: ignore
elif selected_format == FileFormat.TikZ:
return ImportGraphOutput(selected_format, file_path, GraphT.from_tikz(data)) # type: ignore
try:
return ImportGraphOutput(selected_format, file_path, GraphT.from_tikz(data)) # type: ignore
except ValueError:
raise ValueError("Probable reason: attempted to import a proof from TikZ, which is not supported.")
else:
assert selected_format == FileFormat.All
try:
Expand Down

0 comments on commit f0dafa3

Please sign in to comment.