lib/google_pubsub_enhancer.rb in google-pubsub-enhancer-0.1.5 vs lib/google_pubsub_enhancer.rb in google-pubsub-enhancer-0.2.0

- old
+ new

@@ -14,10 +14,12 @@ end def pubsub_config key = ::Google::Cloud::Pubsub::Credentials::JSON_ENV_VARS.find { |n| !ENV[n].nil? } @pubsub_config ||= JSON.parse(ENV[key]) + rescue => ex + raise Exception, 'Environment not setted properly' end end def initialize(&block) @stack = ::Middleware::Builder.new(&block) @@ -42,9 +44,11 @@ end end def create_subscription(subscription_short_name) Google::Cloud::Pubsub.new.subscription(self.class.name_by('subscriptions', subscription_short_name)) + rescue => ex + raise Exception, 'Environment not setted properly' end def configurate_options(opts) raise unless opts.is_a?(Hash) opts[:shutdown] ||= proc { }