Sha256: 872894468a0b85371c8a813da3443b6b9f76a096096c3254de00121e4ba6f8fc

Contents?: true

Size: 790 Bytes

Versions: 13

Compression:

Stored size: 790 Bytes

Contents

require 'paint'
module SiteHook
  class SiteHookError < StandardError
    def initialize(msg, err)
      super(msg)
      exit err
    end
  end
  class ConfigExistsError < SiteHookError
  end
  class NoConfigError < SiteHookError
    attr_reader :path
    def initialize(path)
      @str = "Config path '#{Paint[path, 'red']}' does not exist!"
      @path = path
      super(@str,98)
    end
  end
  class NeitherConfigError < SiteHookError
    attr_reader :paths
    def initialize
      @str = "Neither '#{SiteHook::Paths.old_config}' nor '#{SiteHook::Paths.config}'"
    end
  end
  class NoLogsError < SiteHookError
    attr_reader :path
    def initialize(path)
      @str = "Log path '#{Paint[path, 'red']}' does not exist!"
      @path = path
      super(@str,97)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
site_hook-0.9.16 lib/site_hook/exceptions.rb
site_hook-0.9.15 lib/site_hook/exceptions.rb
site_hook-0.9.14 lib/site_hook/exceptions.rb
site_hook-0.9.12 lib/site_hook/exceptions.rb
site_hook-0.9.11 lib/site_hook/exceptions.rb
site_hook-0.9.10 lib/site_hook/exceptions.rb
site_hook-0.9.9 lib/site_hook/exceptions.rb
site_hook-0.9.8 lib/site_hook/exceptions.rb
site_hook-0.9.7 lib/site_hook/exceptions.rb
site_hook-0.9.6 lib/site_hook/exceptions.rb
site_hook-0.9.5 lib/site_hook/exceptions.rb
site_hook-0.9.4 lib/site_hook/exceptions.rb
site_hook-0.9.3 lib/site_hook/exceptions.rb