Commit 474db93 1 parent 3d336e8 commit 474db93 Copy full SHA for 474db93
File tree 2 files changed +5
-12
lines changed
test/Mathlib/ReplMathlibTests
2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ def unpickleProofSnapshot (n : UnpickleProofState) : M IO ProofStepResponse := d
161
161
/--
162
162
Run a command, returning the id of the new environment, and any messages and sorries.
163
163
-/
164
- def runCommand (s : Command) : M m (CommandResponse ⊕ Error) := do
164
+ def runCommand (s : Command) : M IO (CommandResponse ⊕ Error) := do
165
165
let (cmdSnapshot?, notFound) ← do match s.env with
166
166
| none => pure (none, false )
167
167
| some i => do match (← get).cmdStates[i]? with
@@ -170,7 +170,10 @@ def runCommand (s : Command) : M m (CommandResponse ⊕ Error) := do
170
170
if notFound then
171
171
return .inr ⟨"Unknown environment." ⟩
172
172
let cmdState? := cmdSnapshot?.map fun c => c.cmdState
173
- let (cmdState, messages, trees) ← IO.processInput s.cmd cmdState?
173
+ let (cmdState, messages, trees) ← try
174
+ IO.processInput s.cmd cmdState?
175
+ catch ex =>
176
+ return .inr ⟨ex.toString⟩
174
177
let messages ← messages.mapM fun m => Message.of m
175
178
let sorries ← sorries trees
176
179
let tactics ← match s.allTactics with
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments