diff options
author | Hemant Kumar <gethemant@gmail.com> | 2013-07-26 00:43:15 +0530 |
---|---|---|
committer | Hemant Kumar <gethemant@gmail.com> | 2013-07-26 00:43:15 +0530 |
commit | ff269383b8572e9403a522a66e4be0837636f8ae (patch) | |
tree | 5e09b93451451c3fc14c099ac909e0a981d8feff /lib | |
parent | 1a493004fd0646d53633eadcb02de17b206289b9 (diff) | |
download | bundler-ff269383b8572e9403a522a66e4be0837636f8ae.tar.gz |
Raise user friendly errors in case of Cyclic Dependency
Fixes #2506
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler.rb | 31 | ||||
-rw-r--r-- | lib/bundler/spec_set.rb | 7 |
2 files changed, 22 insertions, 16 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index ea5673a32a..b0cf21a49d 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -50,21 +50,22 @@ module Bundler end end - class GemfileNotFound < BundlerError; status_code(10) ; end - class GemNotFound < BundlerError; status_code(7) ; end - class GemfileError < BundlerError; status_code(4) ; end - class InstallError < BundlerError; status_code(5) ; end - class InstallHookError < BundlerError; status_code(6) ; end - class PathError < BundlerError; status_code(13) ; end - class GitError < BundlerError; status_code(11) ; end - class DeprecatedError < BundlerError; status_code(12) ; end - class GemspecError < BundlerError; status_code(14) ; end - class InvalidOption < BundlerError; status_code(15) ; end - class ProductionError < BundlerError; status_code(16) ; end - class HTTPError < BundlerError; status_code(17) ; end - class RubyVersionMismatch < BundlerError; status_code(18) ; end - class SecurityError < BundlerError; status_code(19) ; end - class LockfileError < BundlerError; status_code(20) ; end + class GemfileNotFound < BundlerError; status_code(10) ; end + class GemNotFound < BundlerError; status_code(7) ; end + class GemfileError < BundlerError; status_code(4) ; end + class InstallError < BundlerError; status_code(5) ; end + class InstallHookError < BundlerError; status_code(6) ; end + class PathError < BundlerError; status_code(13) ; end + class GitError < BundlerError; status_code(11) ; end + class DeprecatedError < BundlerError; status_code(12) ; end + class GemspecError < BundlerError; status_code(14) ; end + class InvalidOption < BundlerError; status_code(15) ; end + class ProductionError < BundlerError; status_code(16) ; end + class HTTPError < BundlerError; status_code(17) ; end + class RubyVersionMismatch < BundlerError; status_code(18) ; end + class SecurityError < BundlerError; status_code(19) ; end + class LockfileError < BundlerError; status_code(20) ; end + class CyclicDependencyError < BundlerError; status_code(21) ; end # Internal errors, should be rescued class VersionConflict < BundlerError diff --git a/lib/bundler/spec_set.rb b/lib/bundler/spec_set.rb index 2cdffdc83f..202993e441 100644 --- a/lib/bundler/spec_set.rb +++ b/lib/bundler/spec_set.rb @@ -109,7 +109,12 @@ module Bundler def sorted rake = @specs.find { |s| s.name == 'rake' } - @sorted ||= ([rake] + tsort).compact.uniq + begin + @sorted ||= ([rake] + tsort).compact.uniq + rescue TSort::Cyclic + raise CyclicDependencyError.new("Bundler has detected cyclic dependencies and can't" + + " proceed, update your Gemfile by removing cyclic dependency and rerun bundler.") + end end def lookup |