Skip to content

Commit

Permalink
[api] improve error message on multiple target repos
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Mar 26, 2014
1 parent c801621 commit a239abc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/api/app/models/channel_target.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ def self.find_by_repo(repo, projectFilter=nil)
end
return nil if ct.length < 1

raise "Multiple channel targets found" if ct.length > 1
if ct.length > 1
msg=""
ct.each do |cti|
msg << "#{cti.channel.package.project.name}/#{cti.channel.package.name}, "
end
raise "Multiple channel targets found in #{msg}"
end
return ct.first
end

Expand Down

0 comments on commit a239abc

Please sign in to comment.