Skip to content

Commit 60e3177

Browse files
committed
feat: add error handling for invalid exp + edit exp input
1 parent f633639 commit 60e3177

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

web/webapp.lisp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ try {
6868
(defun truth-table (exp)
6969
(with-output-to-string (s)
7070
(let ((inference:*output-stream* s))
71-
(inference:print-truth-table (inference:parse-logic exp)))))
71+
(handler-case (inference:print-truth-table
72+
(inference:parse-logic exp))
73+
(error (c)
74+
(format s "ERROR: invalid logic expression"))))))
7275

7376
(defun create-table (exp-string)
7477
(make-instance 'table
@@ -95,7 +98,7 @@ try {
9598
:id "prop-input"
9699
:style "text-align:center;"
97100
:name "prop"
98-
:placeholder (prop table))
101+
:value (prop table))
99102
(:input :type "submit"
100103
:value "Eval")
101104
(:input :type "button"

0 commit comments

Comments
 (0)