Verified Commit e4598982 authored by Hercules Merscher's avatar Hercules Merscher 🌴
Browse files

fix: Exceptions

parent 3e9275e7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,6 +4,6 @@ module Labkit
  module CoveredExperience
    CoveredExperienceError = Class.new(StandardError)
    UnstartedError = Class.new(CoveredExperienceError)
    NotFoundError = Class.new(StandardError)
    NotFoundError = Class.new(CoveredExperienceError)
  end
end
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ module Labkit
          self
        rescue StandardError => e
          error!(e)
          raise(CoveredExperienceError, e)
          raise
        ensure
          complete
        end
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ RSpec.describe Labkit::CoveredExperience::Experience, :with_metrics_config do
      it 'captures exceptions and marks as error' do
        expect do
          experience.start { raise 'Something went wrong' }
        end.to raise_error(Labkit::CoveredExperience::CoveredExperienceError, 'Something went wrong')
        end.to raise_error(RuntimeError, 'Something went wrong')
        .and complete_covered_experience(:testing_sample, error: true)
      end
    end