Skip to content

Commit ae699ff

Browse files
committed
Tweak 'config missig' error message
Config can be blank if exception is thrown while processing the file due to YAML syntax error
1 parent 83b1f39 commit ae699ff

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/travis/model/request/approval.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def message
6969
elsif disabled_in_settings?
7070
request.pull_request? ? 'pull requests disabled' : 'pushes disabled'
7171
elsif request.config.blank?
72-
'missing config'
72+
'config is missing or contains YAML syntax error'
7373
elsif github_pages?
7474
'github pages branch'
7575
elsif !branch_approved? || !branch_accepted?

lib/travis/model/request/states.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def configure
3434

3535
def finish
3636
if config.blank?
37-
Travis.logger.warn("[request:finish] Request not creating a build: config is blank, config=#{config.inspect} commit=#{commit.try(:commit).inspect}")
37+
Travis.logger.warn("[request:finish] Request not creating a build: config is blank or contains YAML syntax error, config=#{config.inspect} commit=#{commit.try(:commit).inspect}")
3838
elsif !approved?
3939
Travis.logger.warn("[request:finish] Request not creating a build: not approved commit=#{commit.try(:commit).inspect} message=#{approval.message.inspect}")
4040
elsif parse_error?

spec/travis/model/request/approval_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@
142142
approval.message.should == 'github pages branch'
143143
end
144144

145-
it 'returns "missing config" if the config is not present' do
145+
it 'returns "config is missing or contains YAML syntax error" if the config is not present' do
146146
request.stubs(:config).returns(nil)
147-
approval.message.should == 'missing config'
147+
approval.message.should == 'config is missing or contains YAML syntax error'
148148
end
149149

150150
it 'returns "branch not included or excluded" if the branch was not approved' do

0 commit comments

Comments
 (0)