mirror of https://github.com/docker/compose.git
Merge pull request #180 from orchardup/better-error-message-for-broken-links
Improve error message when link does not exist
This commit is contained in:
commit
4a90a7691b
|
@ -58,7 +58,11 @@ class Project(object):
|
|||
service_name, link_name = link.split(':', 1)
|
||||
else:
|
||||
service_name, link_name = link, None
|
||||
links.append((project.get_service(service_name), link_name))
|
||||
try:
|
||||
links.append((project.get_service(service_name), link_name))
|
||||
except NoSuchService:
|
||||
raise ConfigurationError('Service "%s" has a link to service "%s" which does not exist.' % (service_dict['name'], service_name))
|
||||
|
||||
del service_dict['links']
|
||||
project.services.append(Service(client=client, project=name, links=links, **service_dict))
|
||||
return project
|
||||
|
|
Loading…
Reference in New Issue