lib/cloud_powers/helper.rb in cloud_powers-0.2.7.17 vs lib/cloud_powers/helper.rb in cloud_powers-0.2.7.18

- old
+ new

@@ -137,11 +137,11 @@ # Returns # +String+ def format_error_message(error) begin [error.message, error.backtrace.join("\n")].join("\n") - rescue Exception => e + rescue Exception # if the formatting won't work, return the original exception error end end @@ -270,11 +270,11 @@ # * See +#task_home()+ def task_exist?(file) begin File.new("#{task_home}/#{file}") true - rescue Errno::ENOENT => e + rescue Errno::ENOENT false end end # Gives the path from the project root to lib/tasks[/file] @@ -291,11 +291,11 @@ # * See <tt>#task_home</tt> def task_require_path(file_name = '') begin file_sans_extension = File.basename(file_name, '.*') (Pathname.new(task_home) + file_sans_extension).to_s - rescue Errno::ENOENT => e + rescue Errno::ENOENT nil end end # Change strings into camelCase @@ -431,10 +431,10 @@ # +Boolean+ def valid_json?(json) begin JSON.parse(json) true - rescue Exception => e + rescue Exception false end end # Predicate method to check if a String is a valid URL