Sha256: 8e9c7b0b1889718c7a1fe1295b43e4f2a7abb11f01db192110b48a8373802ddb

Contents?: true

Size: 1.07 KB

Versions: 7

Compression:

Stored size: 1.07 KB

Contents

module Bundler
  def self.with_friendly_errors
    begin
      yield
    rescue Bundler::BundlerError => e
      Bundler.ui.error e.message
      Bundler.ui.trace e
      exit e.status_code
    rescue Interrupt => e
      Bundler.ui.error "\nQuitting..."
      Bundler.ui.trace e
      exit 1
    rescue SystemExit => e
      exit e.status
    rescue LoadError => e
      case e.message
      when /cannot load such file -- openssl/, /openssl.so/, /libcrypto.so/
        Bundler.ui.error "\nCould not load OpenSSL."
        Bundler.ui.warn "You must recompile Ruby with OpenSSL support or change the sources in your" \
          "\nGemfile from 'https' to 'http'. Instructions for compiling with OpenSSL" \
          "\nusing RVM are available at rvm.io/packages/openssl."
        Bundler.ui.trace e
        exit 1
      else
        raise e
      end
    rescue Exception => e
      Bundler.ui.error(
        "Unfortunately, a fatal error has occurred. Please see the Bundler \n" \
        "troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!\n")
      raise e
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bundler-1.3.0.pre.7 lib/bundler/friendly_errors.rb
bundler-1.3.0.pre.6 lib/bundler/friendly_errors.rb
bundler-1.3.0.pre.5 lib/bundler/friendly_errors.rb
bundler-1.3.0.pre.4 lib/bundler/friendly_errors.rb
bundler-1.3.0.pre.3 lib/bundler/friendly_errors.rb
bundler-1.3.0.pre.2 lib/bundler/friendly_errors.rb
bundler-1.3.0.pre lib/bundler/friendly_errors.rb