def try_checkpoint checkpointer, sequence_number, try_count
      seq = sequence_number.to_s if sequence_number
      checkpointer.checkpoint seq

      true
    rescue Aws::KCLrb::CheckpointError => checkpoint_error
      case checkpoint_error.to_s
      when 'ShutdownException'
        LOG.info 'Encountered shutdown execption, skipping checkpoint'
        true
      when 'ThrottlingException'
        if checkpoint_retries - 1 == try_count
          LOG.error "Failed to checkpoint after #{try_count} attempts, giving up."
          true
        else
          LOG.info "Was throttled while checkpointing, will attempt again in #{sleep_seconds} seconds"
          false
        end
      when 'InvalidStateException'
        LOG.error "MultiLangDaemon reported an invalid state while checkpointing."
        false
      else
        LOG.error "Encountered an error while checkpointing, error was #{checkpoint_error}."
        false
      end
    end
def try_checkpoint checkpointer, sequence_number, try_count
      seq = sequence_number.to_s if sequence_number
      checkpointer.checkpoint seq

      true
    rescue Aws::KCLrb::CheckpointError => checkpoint_error
      case checkpoint_error.to_s
      when 'ShutdownException'
        LOG.info 'Encountered shutdown execption, skipping checkpoint'
        true
      when 'ThrottlingException'
        if checkpoint_retries - 1 == try_count
          LOG.error "Failed to checkpoint after #{try_count} attempts, giving up."
          true
        else
          LOG.info "Was throttled while checkpointing, will attempt again in #{sleep_seconds} seconds"
          false
        end
      when 'InvalidStateException'
        LOG.error "MultiLangDaemon reported an invalid state while checkpointing."
        false
      else
        LOG.error "Encountered an error while checkpointing, error was #{checkpoint_error}."
        false
      end
    end
rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity