<commit_before>require 'bigcommerce'

Bigcommerce.configure do |config|
  config.store_hash = ENV['BC_STORE_HASH']
  config.client_id = ENV['BC_CLIENT_ID']
  config.access_token = ENV['BC_ACCESS_TOKEN']
end

# rubocop:disable MethodLength, Metrics/AbcSize:
def bc_handle_exception
  # Below is a list of all the errors we will throw
  yield
rescue Bigcommerce::BadRequest => e
  puts e.inspect
rescue Bigcommerce::Unauthorized => e
  puts e.inspect
rescue Bigcommerce::Forbidden => e
  puts e.inspect
rescue Bigcommerce::NotFound => e
  puts e.inspect
rescue Bigcommerce::MethodNotAllowed => e
  puts e.inspect
rescue Bigcommerce::NotAccepted => e
  puts e.inspect
rescue Bigcommerce::TimeOut => e
  puts e.inspect
rescue Bigcommerce::ResourceConflict => e
  puts e.inspect
rescue Bigcommerce::TooManyRequests => e
  puts e.inspect
rescue Bigcommerce::InternalServerError => e
  puts e.inspect
rescue Bigcommerce::BadGateway => e
  puts e.inspect
rescue Bigcommerce::ServiceUnavailable => e
  puts e.inspect
rescue Bigcommerce::GatewayTimeout => e
  puts e.inspect
rescue Bigcommerce::BandwidthLimitExceeded => e
  puts e.inspect
rescue => e
  puts "Some other Error #{e.inspect}"
end

Bigcommerce::HttpError::ERRORS.each do |k, v|
  bc_handle_exception do
    # This will be your request that you want to protect from exceptions
    raise v, k
  end
end<commit_msg>Fix exception handling example typo<commit_after>require 'bigcommerce'

Bigcommerce.configure do |config|
  config.store_hash = ENV['BC_STORE_HASH']
  config.client_id = ENV['BC_CLIENT_ID']
  config.access_token = ENV['BC_ACCESS_TOKEN']
end

# rubocop:disable MethodLength, Metrics/AbcSize:
def bc_handle_exception
  # Below is a list of all the errors we will throw
  yield
rescue Bigcommerce::BadRequest => e
  puts e.inspect
rescue Bigcommerce::Unauthorized => e
  puts e.inspect
rescue Bigcommerce::Forbidden => e
  puts e.inspect
rescue Bigcommerce::NotFound => e
  puts e.inspect
rescue Bigcommerce::MethodNotAllowed => e
  puts e.inspect
rescue Bigcommerce::NotAccepted => e
  puts e.inspect
rescue Bigcommerce::TimeOut => e
  puts e.inspect
rescue Bigcommerce::ResourceConflict => e
  puts e.inspect
rescue Bigcommerce::TooManyRequests => e
  puts e.inspect
rescue Bigcommerce::InternalServerError => e
  puts e.inspect
rescue Bigcommerce::BadGateway => e
  puts e.inspect
rescue Bigcommerce::ServiceUnavailable => e
  puts e.inspect
rescue Bigcommerce::GatewayTimeout => e
  puts e.inspect
rescue Bigcommerce::BandwidthLimitExceeded => e
  puts e.inspect
rescue => e
  puts "Some other Error #{e.inspect}"
end

Bigcommerce::HttpErrors::ERRORS.each do |k, v|
  bc_handle_exception do
    # This will be your request that you want to protect from exceptions
    raise v, k
  end
end
{'fraction_non_alphanumeric': 0.08711433756805807, 'fraction_numerical': 0.0, 'mean_word_length': 5.030634573304158, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, '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': '6934905', 'n_tokens_mistral': 884, 'n_tokens_neox': 923, 'n_words': 263}