Sha256: 74e32e81392f997dca0f53d3a4cdcd33ebe270d39fc86710b2ca2b35a6573c30

Contents?: true

Size: 1.27 KB

Versions: 34

Compression:

Stored size: 1.27 KB

Contents

module S3Website
  class S3WebsiteError < StandardError
  end

  class NoWebsiteDirectoryFound < S3WebsiteError
    def initialize(message = "I can't find any website. Are you in the right directory?")
      super(message)
    end
  end

  class NoPredefinedWebsiteDirectoryFound < NoWebsiteDirectoryFound
    def initialize(message = "I can't find a website in any of the following directories: #{Paths.site_paths.join(', ')}. Please specify the location of the website with the --site option.")
      super(message)
    end
  end

  class NoConfigurationFileError < S3WebsiteError
    def initialize(message = "I've just generated a file called s3_website.yml. Go put your details in it!")
      super(message)
    end
  end

  class MalformedConfigurationFileError < S3WebsiteError
    def initialize(message = "I can't parse the file s3_website.yml. It should look like this:\n#{ConfigLoader.read_configuration_file_template}")
      super(message)
    end
  end

  class RetryAttemptsExhaustedError < S3WebsiteError
    def initialize(message = "Operation failed even though we tried to recover from it")
      super(message)
    end
  end

  def self.error_report(error)
    if error.is_a? S3WebsiteError
      "#{error.message}"
    else
      "#{error.message} (#{error.class})"
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
s3_website-1.8.2 lib/s3_website/errors.rb
s3_website-1.8.1 lib/s3_website/errors.rb
s3_website-1.8.0 lib/s3_website/errors.rb
s3_website_monadic-0.0.15 lib/s3_website/errors.rb
s3_website_monadic-0.0.14 lib/s3_website/errors.rb
s3_website_monadic-0.0.13 lib/s3_website/errors.rb
s3_website_monadic-0.0.12 lib/s3_website/errors.rb
s3_website_monadic-0.0.11 lib/s3_website/errors.rb
s3_website_monadic-0.0.9 lib/s3_website/errors.rb
s3_website_monadic-0.0.8 lib/s3_website/errors.rb
s3_website_monadic-0.0.7 lib/s3_website/errors.rb
s3_website_monadic-0.0.6 lib/s3_website/errors.rb
s3_website_monadic-0.0.5 lib/s3_website/errors.rb
s3_website-1.7.6 lib/s3_website/errors.rb
s3_website_monadic-0.0.4 lib/s3_website/errors.rb
s3_website_monadic-0.0.3 lib/s3_website/errors.rb
s3_website-1.7.5 lib/s3_website/errors.rb
s3_website_monadic-0.0.2 lib/s3_website/errors.rb
s3_website_monadic-0.0.1 lib/s3_website/errors.rb
s3_website-1.7.4 lib/s3_website/errors.rb