yoheinakajima / instagraph

Converts text input or URL into knowledge graph and displays
MIT License
3.47k stars 289 forks source link

Handle no neo4j case gracefully #55

Closed snakajima closed 1 year ago

snakajima commented 1 year ago

Summary by CodeRabbit

coderabbitai[bot] commented 1 year ago

Walkthrough

The get_graph_history function in main.py has been enhanced to handle the case when the Neo4j driver is not initialized correctly. It now includes a new key "neo4j" in the JSON response to indicate the driver's status, improving error handling and response clarity.

Changes

File Summary
main.py The get_graph_history function now checks if the Neo4j driver is initialized and returns an appropriate response. A new key "neo4j" is added to the JSON response to indicate the driver's status. This change improves error handling and provides more information in the response.

🐇

"In the land of code, where logic intertwines,

A rabbit hops, leaving bugs behind.

With each key press, a new world unfurls,

In the realm of brackets, where the Neo4j whirls.

Now clearer responses, our function sends,

A tale of success, that never ends." 🎉


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - Mention `@coderabbitai` in any *review comment* for bot assistance. - Note: Review comments are made on code diffs or files, not on the PR overview. ### Pause Incremental Reviews - Insert `@coderabbitai: ignore` in the PR description to halt the bot's ongoing reviews. Remove the line to resume. - Additionally, enter `@coderabbitai pause` to halt the bot's ongoing reviews as any issue or review comment. To resume reviews, enter `@coderabbitai resume` as any issue or review comment.