lib/steppy/error.rb in steppy-0.6.0 vs lib/steppy/error.rb in steppy-0.7.0

- old
+ new

@@ -1,15 +1,15 @@ # frozen_string_literal: true # Incase you need to throw an error related to steppy class SteppyError < StandardError - attr_reader :step + attr_reader :steppy # rubocop:disable Airbnb/OptArgParameters - def initialize(step = nil) + def initialize(steppy = nil) # rubocop:enable Airbnb/OptArgParameters - if step - @step = step - message = step.to_json + if steppy + @steppy = steppy + message = steppy.is_a?(String) ? steppy : steppy.to_json end super(message) end end