From 388c23b95af85c7466f752d56a1fae6c65af5da7 Mon Sep 17 00:00:00 2001 From: Eyal Date: Mon, 22 Feb 2016 16:52:44 +0200 Subject: [PATCH] put the call under try catch Change-Id: I2d160f744f1381b4b9be486b6b64a8cc843583f2 --- vitrage/api/controllers/v1/topology.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vitrage/api/controllers/v1/topology.py b/vitrage/api/controllers/v1/topology.py index 7add99d1e..30a417948 100644 --- a/vitrage/api/controllers/v1/topology.py +++ b/vitrage/api/controllers/v1/topology.py @@ -72,12 +72,12 @@ class TopologyController(rest.RestController): return self.get_graph(graph_type, depth, query, root) def get_graph(self, graph_type, depth, query, root): - graph_data = self.client.call(self.ctxt, 'get_topology', - graph_type=graph_type, depth=depth, - query=query, root=root) - LOG.info(graph_data) try: + graph_data = self.client.call(self.ctxt, 'get_topology', + graph_type=graph_type, depth=depth, + query=query, root=root) + LOG.info(graph_data) graph = json.loads(graph_data) if graph_type == 'graph': return graph @@ -85,7 +85,7 @@ class TopologyController(rest.RestController): return as_tree(graph) except Exception as e: - LOG.exception('failed to open file %s ', e) + LOG.exception('failed to get topology %s ', e) abort(404, str(e)) @staticmethod