Skip to content

Commit

Permalink
adaptive the err judge
Browse files Browse the repository at this point in the history
  • Loading branch information
lyh169 committed Oct 23, 2023
1 parent cd0ac1e commit ba3b145
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jsonrpc/endpoints_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (d *DebugEndpoints) TraceBatchByNumber(httpRequest *http.Request, number ty
}

batch, err := d.state.GetBatchByNumber(ctx, batchNumber, dbTx)
if errors.Is(err, state.ErrNotFound) {
if errors.Is(err, state.ErrStateNotSynchronized) {
return nil, types.NewRPCError(types.DefaultErrorCode, fmt.Sprintf("batch #%d not found", batchNumber))
} else if err != nil {
return RPCErrorResponse(types.DefaultErrorCode, "failed to get batch by number", err)
Expand Down

0 comments on commit ba3b145

Please sign in to comment.