Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pip install prompt-toolkit

```python
from jsondb import JsonDB
from jsondb.exceptions import TableExistsError, JsonDBError

# Initialize the database
db = JsonDB('my_database.json')
Expand All @@ -68,9 +69,9 @@ try:
# Show final data
db.show_data('users')

except db.TableExistsError as e:
except TableExistsError as e:
print(f"Setup failed because a table already exists: {e}")
except db.Error as e: # Catch any library-specific error
except JsonDBError as e: # Catch any library-specific error
print(f"An error occurred with the database: {e}")
except Exception as e:
print(f"A general error occurred: {e}")
Expand Down