Sha256: 6d438f3bef1e8e41e37193c2f63bff28c2418dc3e686a6365975ba0ded4375c3

Contents?: true

Size: 1.75 KB

Versions: 64

Compression:

Stored size: 1.75 KB

Contents

#
# Copyright:: Copyright 2016, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

module LicenseScout
  module Exceptions
    class Error < RuntimeError; end

    class ProjectDirectoryMissing < Error
      def initialize(project_dir)
        @project_dir = project_dir
      end

      def to_s
        "Could not locate or access the provided project directory '#{@project_dir}'."
      end
    end

    class UnsupportedProjectType < Error
      def initialize(project_dir)
        @project_dir = project_dir
      end

      def to_s
        "Could not find a supported dependency manager for the project in the provided directory '#{@project_dir}'."
      end
    end

    class InaccessibleDependency < Error; end
    class InvalidOverride < Error; end
    class InvalidOutputReport < Error; end
    class InvalidManualDependency < Error; end

    class NetworkError < Error

      attr_reader :from_url
      attr_reader :network_error

      def initialize(from_url, network_error)
        @from_url = from_url
        @network_error = network_error
      end

      def to_s
        [
          "Network error while fetching '#{from_url}'",
          network_error.to_s,
        ].join("\n")
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
license_scout-1.0.25 lib/license_scout/exceptions.rb
license_scout-1.0.24 lib/license_scout/exceptions.rb
license_scout-1.0.22 lib/license_scout/exceptions.rb
license_scout-1.0.21 lib/license_scout/exceptions.rb
license_scout-1.0.20 lib/license_scout/exceptions.rb
license_scout-1.0.19 lib/license_scout/exceptions.rb
license_scout-1.0.18 lib/license_scout/exceptions.rb
license_scout-1.0.17 lib/license_scout/exceptions.rb
license_scout-1.0.16 lib/license_scout/exceptions.rb
license_scout-1.0.15 lib/license_scout/exceptions.rb
license_scout-1.0.14 lib/license_scout/exceptions.rb
license_scout-1.0.13 lib/license_scout/exceptions.rb
license_scout-1.0.12 lib/license_scout/exceptions.rb
license_scout-1.0.11 lib/license_scout/exceptions.rb
license_scout-1.0.10 lib/license_scout/exceptions.rb
license_scout-1.0.9 lib/license_scout/exceptions.rb
license_scout-1.0.8 lib/license_scout/exceptions.rb
license_scout-1.0.5 lib/license_scout/exceptions.rb
license_scout-1.0.4 lib/license_scout/exceptions.rb
license_scout-1.0.3 lib/license_scout/exceptions.rb