lib/appfuel/application/dispatcher.rb in appfuel-0.2.10 vs lib/appfuel/application/dispatcher.rb in appfuel-0.2.11
- old
+ new
@@ -3,28 +3,17 @@
module Dispatcher
def dispatch(request, container)
begin
container[:feature_initializer].call(request.feature, container)
- action = container[:action_loader].call(request.namespace, container)
+ action = container[:action_loader].call(request.namespace, container)
response = action.run(request.inputs)
rescue => e
- handle_error(e, container)
+ handler = Appfuel::ResponseHandler.new
+ response = handler.error(e)
end
- if response.failure?
- handle_error(contaier, :failed, error)
- end
- end
-
- private
- def handle_error(e, container)
- p e.message
- p e.backtrace
- end
-
- def default_error_handling(e, container)
-
+ response
end
end
end
end