Skip to content

Commit dbfdbc5

Browse files
authored
Fix %status output for Blazegraph (#137)
Co-authored-by: Michael Chin <chnmch@amazon.com>
1 parent ea162e4 commit dbfdbc5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/graph_notebook/magics/graph_magic.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,16 @@ def status(self, line):
471471
logger.info(f'calling for status on endpoint {self.graph_notebook_config.host}')
472472
status_res = self.client.status()
473473
status_res.raise_for_status()
474-
res = status_res.json()
475-
logger.info(f'got the response {res}')
476-
return res
474+
try:
475+
res = status_res.json()
476+
logger.info(f'got the json format response {res}')
477+
return res
478+
except ValueError:
479+
logger.info(f'got the HTML format response {status_res.text}')
480+
print("For more information on the status of your Blazegraph cluster, please visit: ")
481+
print()
482+
print(f'http://{self.graph_notebook_config.host}:{self.graph_notebook_config.port}/blazegraph/#status')
483+
return status_res
477484

478485
@line_magic
479486
@display_exceptions

0 commit comments

Comments
 (0)