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:
Aanand Prasad 2014-04-05 17:29:08 +01:00
commit 4a90a7691b
1 changed files with 5 additions and 1 deletions

View File

@ -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