summaryrefslogtreecommitdiff
path: root/lib/bundler/friendly_errors.rb
diff options
context:
space:
mode:
authorAgis Anastasopoulos <agis.anast@gmail.com>2015-10-28 15:30:22 +0200
committerAgis Anastasopoulos <agis.anast@gmail.com>2015-10-28 15:43:19 +0200
commitdf6f695a28292787640a4d9489d56c57e8c6ca2d (patch)
treea4aaaa8243ea70a8d3b4d63341098ecbb350c292 /lib/bundler/friendly_errors.rb
parent9e6f9d88b91d9d0644ee610d7cea09aebc43751f (diff)
downloadbundler-handle-psych-errors.tar.gz
Handle invalid RubyGems config fileshandle-psych-errors
Fixes #4042.
Diffstat (limited to 'lib/bundler/friendly_errors.rb')
-rw-r--r--lib/bundler/friendly_errors.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb
index e60f73f7df..f6f8fd5623 100644
--- a/lib/bundler/friendly_errors.rb
+++ b/lib/bundler/friendly_errors.rb
@@ -5,6 +5,10 @@ require "bundler/vendored_thor"
module Bundler
def self.with_friendly_errors
yield
+ rescue YAMLSyntaxError => e
+ Bundler.ui.error e.message
+ Bundler.ui.trace e.orig_exception
+ exit e.status_code
rescue Bundler::Dsl::DSLError => e
Bundler.ui.error e.message
exit e.status_code