Skip to content

Commit

Permalink
feat(logic): return rpc error when interpreter enconter an error
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Jun 8, 2023
1 parent 00996dc commit 2aed7e7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions x/logic/keeper/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ func (k Keeper) execute(ctx goctx.Context, program, query string) (*types.QueryS
results = append(results, types.Result{Substitutions: m.ToSubstitutions()})
}

if sols.Err() != nil && sdkCtx.GasMeter().IsOutOfGas() {
panic(sdk.ErrorOutOfGas{Descriptor: "Prolog interpreter execution"})
if err := sols.Err(); err != nil {
if sdkCtx.GasMeter().IsOutOfGas() {
panic(sdk.ErrorOutOfGas{Descriptor: "Prolog interpreter execution"})
}
return nil, err
}

var userOutput string
Expand Down

0 comments on commit 2aed7e7

Please sign in to comment.