Move OtherWMRunningError message in the class

This commit is contained in:
Thibault Jouan 2015-04-13 21:39:01 +00:00
parent 53d83d5f08
commit 8a97f3c8b8
2 changed files with 7 additions and 4 deletions

View File

@ -14,6 +14,11 @@ module Uh
Error = Class.new(StandardError)
RuntimeError = Class.new(RuntimeError)
ArgumentError = Class.new(Error)
OtherWMRunningError = Class.new(RuntimeError)
class OtherWMRunningError < RuntimeError
def message
'another window manager is already running'
end
end
end
end

View File

@ -13,9 +13,7 @@ module Uh
def connect
@events.emit :connecting, args: @display
@display.open
Display.on_error do
fail OtherWMRunningError, 'another window manager is already running'
end
Display.on_error { fail OtherWMRunningError }
@display.listen_events INPUT_MASK
@display.sync false
Display.on_error { |*args| handle_error *args }