<commit_before>module CallSheet
  module StepAdapters
    class Try < Base
      def initialize(*)
        super
        raise ArgumentError, "+try+ steps require one or more exception classes provided via +catch:+" unless options[:catch]
      end

      def call(*args, input)
        begin
          Success(operation.call(*args, input))
        rescue *Array(options[:catch]) => e
          Failure(e)
        end
      end
    end

    register :try, Try<commit_msg>Use method-level rescue<commit_after>module CallSheet
  module StepAdapters
    class Try < Base
      def initialize(*)
        super
        raise ArgumentError, "+try+ steps require one or more exception classes provided via +catch:+" unless options[:catch]
      end

      def call(*args, input)
        Success(operation.call(*args, input))
      rescue *Array(options[:catch]) => e
        Failure(e)
      end
    end

    register :try, Try
{'fraction_non_alphanumeric': 0.09021739130434783, 'fraction_numerical': 0.0, 'mean_word_length': 2.4365671641791047, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5377426', 'n_tokens_mistral': 247, 'n_tokens_neox': 240, 'n_words': 83}