Sha256: 45ee91487dfd7ad63e2e75d150d53b1925b3938b6de350b54a1f241e2b92f9aa

Contents?: true

Size: 993 Bytes

Versions: 1

Compression:

Stored size: 993 Bytes

Contents

module Pione
  module Location
    # LocationError is raised when any resource errors happen.
    class LocationError < StandardError
      def initialize(location, option={})
        @location = location
        @option = option
      end
    end

    # ExistAlready is raised when there is data on the location already.
    class ExistAlready < LocationError
      def message
        "the location exists already: %s" % @location.inspect
      end
    end

    # NotFound is raised when there isn't data on the location.
    class NotFound < LocationError
      def message
        "%s not found" % @location.inspect
      end
    end

    # InvalidFileOperation represents you do file operation to directory.
    class InvalidFileOperation < LocationError
      def message
        "invalid file operation: %s" % @location.inspect
      end
    end

    class GitError < LocationError
      def message
        "%s: %s" % [@option[:message], @location.address]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pione-0.2.2 lib/pione/location/exception.rb