Sha256: c5693422861068631f8f9fd4b10d95de78f0643018edf9c23596e74dee26f360

Contents?: true

Size: 502 Bytes

Versions: 10

Compression:

Stored size: 502 Bytes

Contents

# frozen_string_literal: true

module Prefab
  module Errors
    class InvalidApiKeyError < Prefab::Error
      def initialize(key)
        if key.nil? || key.empty?
          message = "No API key. Set PREFAB_API_KEY env var or use PREFAB_DATASOURCES=LOCAL_ONLY"

          super(message)
        else
          message = "Your API key format is invalid. Expecting something like 123-development-yourapikey-SDK. You provided `#{key}`"

          super(message)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
prefab-cloud-ruby-0.20.0 lib/prefab/errors/invalid_api_key_error.rb
prefab-cloud-ruby-0.19.0 lib/prefab/errors/invalid_api_key_error.rb
prefab-cloud-ruby-0.18.0 lib/prefab/errors/invalid_api_key_error.rb
prefab-cloud-ruby-0.17.0 lib/prefab/errors/invalid_api_key_error.rb
prefab-cloud-ruby-0.16.0 lib/prefab/errors/invalid_api_key_error.rb
prefab-cloud-ruby-0.15.0 lib/prefab/errors/invalid_api_key_error.rb
prefab-cloud-ruby-0.14.0 lib/prefab/errors/invalid_api_key_error.rb
prefab-cloud-ruby-0.13.3 lib/prefab/errors/invalid_api_key_error.rb
prefab-cloud-ruby-0.13.2 lib/prefab/errors/invalid_api_key_error.rb
prefab-cloud-ruby-0.13.0 lib/prefab/errors/invalid_api_key_error.rb