Skip to content

Commit

Permalink
ファイル出力時のエラーハンドリングを改善
Browse files Browse the repository at this point in the history
  • Loading branch information
moratori committed Jun 17, 2022
1 parent 489b459 commit 1476070
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/rendertree.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,13 @@
(multiple-value-bind (nodes edges)
(%collect-graphviz-node-and-edges target-clause 1)

(with-open-file (handle output :direction :output :if-exists :supersede)
(format handle "digraph refutation_tree {~%")
(format handle "~{ ~A~%~}~%" nodes)
(format handle "~{ ~A~%~}~%" edges)
(format handle "}")))))

(handler-case
(with-open-file (handle output :direction :output :if-exists :supersede)
(format handle "digraph refutation_tree {~%")
(format handle "~{ ~A~%~}~%" nodes)
(format handle "~{ ~A~%~}~%" edges)
(format handle "}"))
(condition (con)
(declare (ignore con))
(format *standard-output* "unable to write file: ~A~%" output))))))

0 comments on commit 1476070

Please sign in to comment.