Skip to content

Commit

Permalink
Merge pull request #66 from EspressoSystems/fix/executor-error-handling
Browse files Browse the repository at this point in the history
Don't segfault when the executor fails with no response
  • Loading branch information
jbearer authored Aug 23, 2023
2 parents 2469f8a + a19ebf8 commit d8cc5fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,10 @@ func (s *State) ExecuteBatch(ctx context.Context, batch Batch, dbTx pgx.Tx) (*pb

processBatchResponse, err := s.executorClient.ProcessBatch(ctx, processBatchRequest)
if err != nil {
if processBatchResponse.Error != executor.EXECUTOR_ERROR_NO_ERROR {
if processBatchResponse == nil {
log.Errorf("error from executor without response: %v", err)
err = executor.ExecutorErr(executor.EXECUTOR_ERROR_UNSPECIFIED)
} else if processBatchResponse.Error != executor.EXECUTOR_ERROR_NO_ERROR {
err = executor.ExecutorErr(processBatchResponse.Error)
s.LogExecutorError(processBatchResponse.Error, processBatchRequest)
}
Expand Down

0 comments on commit d8cc5fa

Please sign in to comment.