From 050f81e37ccb4d454384fa9b932b5a46065c2764 Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Fri, 4 Apr 2014 13:06:52 +0100 Subject: [PATCH] Improve error message when link does not exist --- fig/project.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fig/project.py b/fig/project.py index f89202054..38bbba222 100644 --- a/fig/project.py +++ b/fig/project.py @@ -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