From 1ace3fd6a0ee604884cc79da42ddbc1a7a97ce40 Mon Sep 17 00:00:00 2001 From: Vishrut Shah Date: Mon, 11 Sep 2017 17:49:53 -0700 Subject: [PATCH] Rescue error while publishing --- Rakefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 96fa9d1aca..9f84902281 100644 --- a/Rakefile +++ b/Rakefile @@ -45,8 +45,12 @@ namespace :arm do desc 'Push gem for each of the Azure Resource Manager projects' task :release, [:key] => :build do |_, args| each_gem do |dir| - # Using execute method so that keys are not logged onto console - execute("gem push ./pkg/#{dir}-#{version}.gem" + (args[:key].nil? ? '' : " -k #{args[:key]}")) + begin + # Using execute method so that keys are not logged onto console + execute("gem push ./pkg/#{dir}-#{version}.gem" + (args[:key].nil? ? '' : " -k #{args[:key]}")) + rescue Exception => ex + puts "Error occurred while publishing #{dir}: #{ex}" + end end end