cf 5.2.1.rc6 → 5.2.1.rc7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cf/cli.rb +2 -1
- data/lib/cf/version.rb +1 -1
- data/spec/cf/cli_spec.rb +21 -2
- metadata +2 -2
data/lib/cf/cli.rb
CHANGED
@@ -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
|
data/lib/cf/version.rb
CHANGED
data/spec/cf/cli_spec.rb
CHANGED
@@ -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
|
-
|
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.
|
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: -
|
637
|
+
hash: -3330496737720499293
|
638
638
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
639
639
|
none: false
|
640
640
|
requirements:
|