You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: after_transaction_error_spec.rb
    path of file: ./repos/karafka/spec/integrations/pro/consumption/transactions
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# If transaction finishes and the error is after it, it should not impact the o
    
  def consume
    messages.each do |message|
      DT[:offsets] << message.offset
    end

    transaction do
      mark_as_consumed(messages.first, messages.first.offset.to_s)
    end

    if DT.key?(:raised)
      DT[:done] = true
    else
      DT[:raised] = true
      raise StandardError
    end