Skip to content

Commit

Permalink
fix: prints connection errors for dbsync
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman committed Apr 10, 2024
1 parent 543779c commit 2ddba3d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ async def connect(url: str, *args, **kwargs) -> asyncpg.Connection:
"""
try:
conn = await asyncpg.connect(dsn=url, *args, **kwargs)
except Exception as _:
raise Exception("Database connection failed")
except Exception as e:
raise Exception(f"database connection failed: {e}")

try:
await conn.set_type_codec("jsonb", encoder=json.dumps, decoder=json.loads, schema="pg_catalog")
except Exception as _:
raise Exception("Failed to set jsonb codec")
except Exception as e:
raise Exception(f"failed to set jsonb codec: {e}")

return conn

0 comments on commit 2ddba3d

Please sign in to comment.