Commit fa340595 authored by Robert Speicher's avatar Robert Speicher

Default message for SatelliteNotExistError

parent ae1a3148
module Gitlab module Gitlab
class SatelliteNotExistError < StandardError; end class SatelliteNotExistError < StandardError
def initialize(msg = "Satellite doesn't exist")
super
end
end
module Satellite module Satellite
class Satellite class Satellite
...@@ -17,12 +21,8 @@ module Gitlab ...@@ -17,12 +21,8 @@ module Gitlab
Gitlab::Satellite::Logger.error(message) Gitlab::Satellite::Logger.error(message)
end end
def raise_no_satellite
raise SatelliteNotExistError.new("Satellite doesn't exist")
end
def clear_and_update! def clear_and_update!
raise_no_satellite unless exists? raise SatelliteNotExistError unless exists?
File.exists? path File.exists? path
@repo = nil @repo = nil
...@@ -55,7 +55,7 @@ module Gitlab ...@@ -55,7 +55,7 @@ module Gitlab
# * Changes the current directory to the satellite's working dir # * Changes the current directory to the satellite's working dir
# * Yields # * Yields
def lock def lock
raise_no_satellite unless exists? raise SatelliteNotExistError unless exists?
File.open(lock_file, "w+") do |f| File.open(lock_file, "w+") do |f|
begin begin
...@@ -77,7 +77,7 @@ module Gitlab ...@@ -77,7 +77,7 @@ module Gitlab
end end
def repo def repo
raise_no_satellite unless exists? raise SatelliteNotExistError unless exists?
@repo ||= Grit::Repo.new(path) @repo ||= Grit::Repo.new(path)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment