These are chat archives for dry-rb/chat

20th
Jul 2018
Maru de Vera
@SheepD
Jul 20 2018 12:40

hi guys,

I'm currently having a problem when using around step adapters from dry-transaction

    result = nil
    begin
      ActiveRecord::Base.transaction do
        result = block.call(Success.new(input))
        raise ActiveRecord::Rollback if result.failure?
        result
      end
    rescue ActiveRecord::Rollback
      # in event of a failure, this doesnt get executed
      result
    end

I get an InvalidResultError instead from my step wrapped around the transaction. so im guessing that the error being raised... doesnt get caught by my rescue block?

Tim Riley
@timriley
Jul 20 2018 12:42
@SheepD Could you please post this in the forum along with a bit more code to make it easier to replicate/understand this?
Maru de Vera
@SheepD
Jul 20 2018 12:43
ok