chore: Version 0.3 #136
|
@ -33,11 +33,16 @@ partial def loop : MainM Unit := do
|
||||||
-- Using `Lean.Json.compress` here to prevent newline
|
-- Using `Lean.Json.compress` here to prevent newline
|
||||||
IO.println error.compress
|
IO.println error.compress
|
||||||
| .ok command =>
|
| .ok command =>
|
||||||
|
try
|
||||||
let ret ← execute command
|
let ret ← execute command
|
||||||
let str := match state.options.printJsonPretty with
|
let str := match state.options.printJsonPretty with
|
||||||
| true => ret.pretty
|
| true => ret.pretty
|
||||||
| false => ret.compress
|
| false => ret.compress
|
||||||
IO.println str
|
IO.println str
|
||||||
|
catch e =>
|
||||||
|
let message ← e.toMessageData.toString
|
||||||
|
let error := Lean.toJson ({ error := "io", desc := message }: InteractionError)
|
||||||
|
IO.println error.compress
|
||||||
loop
|
loop
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue