fix: Rectify error format

This commit is contained in:
Leni Aniva 2023-11-09 22:24:17 -08:00
parent c99125c4a6
commit 2a9931c134
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
2 changed files with 5 additions and 6 deletions

View File

@ -193,7 +193,7 @@ def execute (command: Protocol.Command): MainM Lean.Json := do
pure $ target.resume goals
| _, _ => return .error <| errorI "arguments" "Exactly one of {branch, goals} must be supplied"
match nextState? with
| .error error => return .ok { error? := .some error }
| .error error => return .error <| errorI "structure" error
| .ok nextGoalState =>
let nextStateId := state.nextId
set { state with
@ -202,8 +202,8 @@ def execute (command: Protocol.Command): MainM Lean.Json := do
}
let goals ← nextGoalState.serializeGoals (parent := .none) (options := state.options)
return .ok {
nextStateId? := .some nextStateId,
goals? := .some goals,
nextStateId,
goals,
}
goal_delete (args: Protocol.GoalDelete): MainM (CR Protocol.GoalDeleteResult) := do
let state ← get

View File

@ -176,9 +176,8 @@ structure GoalContinue where
goals?: Option (List String) := .none
deriving Lean.FromJson
structure GoalContinueResult where
error?: Option String := .none
nextStateId?: Option Nat := .none
goals?: Option (Array Goal) := .none
nextStateId: Nat
goals: (Array Goal)
deriving Lean.ToJson
-- Remove goal states