lib/activehook/server/errors.rb in activehook-server-0.1.3 vs lib/activehook/server/errors.rb in activehook-server-0.1.4

- old
+ new

@@ -1,12 +1,29 @@ module ActiveHook module Server module Errors - class Config < StandardError; end - class Message < StandardError; end - class HTTP < StandardError; end - class Send < StandardError; end - class Server < StandardError; end - class Worker < StandardError; end + class Base < StandardError + def initialize(msg = nil) + @message = msg + log_error + end + + def message + "The following error occured: #{@message}" + end + + private + + def log_error + ActiveHook::Server.log.err(@message) + end + end + + class Config < Base; end + class Message < Base; end + class HTTP < Base; end + class Send < Base; end + class Manager < Base; end + class Worker < Base; end end end end