Skip to content

Commit

Permalink
improve registry search message
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwelch committed Oct 20, 2014
1 parent 78e2db6 commit e2af064
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def search(term)
{
error: {
registry_id: id,
summary: I18n.t('registry_search_error'),
summary: I18n.t('registry_search_error', name: name),
details: "#{e.class.name}: #{e.message}"
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ en:
</ul>
registry_connection_error: "Docker Registry API is not responding"
registry_search_error: "There was an error performing a search on one of your registries. The endpoint may be invalid or behind authorization."
registry_search_error: "There was an error performing a search on your registry, %{name}. The endpoint may be invalid or behind authorization."
github_connection_error: "GitHub API is not responding"
3 changes: 1 addition & 2 deletions spec/models/registry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@
subject { search[:error] }

its([:registry_id]) { should eq(registry.id) }
its([:summary]) { should eq(I18n.t('registry_search_error')) }
its([:details]) { should eq('StandardError: Error details') }
its([:summary]) { should eq(I18n.t('registry_search_error', name: registry.name)) }
end

context 'when the RegistryClient search is successful' do
Expand Down

0 comments on commit e2af064

Please sign in to comment.