cf 5.2.1.rc6 → 5.2.1.rc7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -156,7 +156,8 @@ EOS
156
156
  rescue CFoundry::StagingError => e
157
157
  message = "Application failed to stage"
158
158
  formatted_exception_output(e, message)
159
-
159
+ rescue CFoundry::APIError => e
160
+ formatted_exception_output(e, add_exception_name_to_msg(e))
160
161
  rescue Exception => e
161
162
  log_error_and_dump_crashlog(e)
162
163
  end
@@ -1,3 +1,3 @@
1
1
  module CF
2
- VERSION = "5.2.1.rc6".freeze
2
+ VERSION = "5.2.1.rc7".freeze
3
3
  end
@@ -139,14 +139,33 @@ module CF
139
139
  end
140
140
  end
141
141
 
142
+ context "with a CFoundry API error" do
143
+ let(:error) { CFoundry::APIError.new("CC had a problem", 123) }
144
+ let(:action) { proc { raise error } }
145
+
146
+ it "prints the error message" do
147
+ subject
148
+ expect(stderr.string).to include "APIError: 123: CC had a problem"
149
+ end
150
+
151
+ it "does not include the crash log" do
152
+ subject
153
+ expect(stderr.string).to_not include "spec/cf/cli_spec.rb"
154
+ end
155
+ end
156
+
142
157
  context "with an arbitrary exception" do
143
158
  let(:error) { RuntimeError.new("ahhhh it's all broken!!!!") }
144
159
  let(:action) { proc { raise error } }
145
160
 
146
- it "prints the message" do
161
+ it "prints the error message" do
147
162
  subject
148
163
  expect(stderr.string).to include "RuntimeError: ahhhh it's all broken!!!!"
149
- expect(stderr.string).to include "spec/cf/cli_spec.rb" #to check that we're printing the backtrace
164
+ end
165
+
166
+ it "prints the crash log" do
167
+ subject
168
+ expect(stderr.string).to include "spec/cf/cli_spec.rb"
150
169
  end
151
170
 
152
171
  it "sets the exit code to 1" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1.rc6
4
+ version: 5.2.1.rc7
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -634,7 +634,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
634
634
  version: '0'
635
635
  segments:
636
636
  - 0
637
- hash: -4512813733364903773
637
+ hash: -3330496737720499293
638
638
  required_rubygems_version: !ruby/object:Gem::Requirement
639
639
  none: false
640
640
  requirements: