@@ -276,7 +276,9 @@ def _execute_sql(
276
276
result = cursor .execute (sql_query , params )
277
277
except Error as e :
278
278
self ._connection .rollback ()
279
- detailed_error_msg = f"{ error_msg } .\n You can find the SQL query and the parameters in the debug logs."
279
+ detailed_error_msg = (
280
+ f"{ error_msg } . Error: { e !r} . \n You can find the SQL query and the parameters in the debug logs."
281
+ )
280
282
raise DocumentStoreError (detailed_error_msg ) from e
281
283
282
284
return result
@@ -314,7 +316,9 @@ async def _execute_sql_async(
314
316
result = await cursor .execute (sql_query , params )
315
317
except Error as e :
316
318
await self ._async_connection .rollback ()
317
- detailed_error_msg = f"{ error_msg } .\n You can find the SQL query and the parameters in the debug logs."
319
+ detailed_error_msg = (
320
+ f"{ error_msg } . Error: { e !r} . \n You can find the SQL query and the parameters in the debug logs."
321
+ )
318
322
raise DocumentStoreError (detailed_error_msg ) from e
319
323
320
324
return result
@@ -795,7 +799,7 @@ def write_documents(self, documents: List[Document], policy: DuplicatePolicy = D
795
799
except Error as e :
796
800
self ._connection .rollback ()
797
801
error_msg = (
798
- "Could not write documents to PgvectorDocumentStore. \n "
802
+ f "Could not write documents to PgvectorDocumentStore. Error: { e !r } . \n "
799
803
"You can find the SQL query and the parameters in the debug logs."
800
804
)
801
805
raise DocumentStoreError (error_msg ) from e
@@ -852,7 +856,7 @@ async def write_documents_async(
852
856
except Error as e :
853
857
await self ._async_connection .rollback ()
854
858
error_msg = (
855
- "Could not write documents to PgvectorDocumentStore. \n "
859
+ f "Could not write documents to PgvectorDocumentStore. Error: { e !r } . \n "
856
860
"You can find the SQL query and the parameters in the debug logs."
857
861
)
858
862
raise DocumentStoreError (error_msg ) from e
0 commit comments