Open cjbj opened 1 month ago
@cjbj I would like to work on this issue. Could you please assign me issue #22410?
@isatyamks I don't have privileges to assign it.
The outer try/except block handles connection errors, and the inner try/except block handles SQL execution errors, providing detailed error messages for both.
try:
conn = oracledb.connect(user=username, password=password, dsn=dsn)
print("Connection successful!")
cursor = conn.cursor() try: cursor.execute( """ begin -- Drop user begin execute immediate 'drop user testuser cascade'; exception when others then dbms_output.put_line('Error dropping user: ' || SQLERRM); end;
@cjbj I hope this change will work...
URL
https://github.com/langchain-ai/langchain/blob/master/cookbook/oracleai_demo.ipynb
Checklist
Issue with current documentation:
The sample code in https://github.com/langchain-ai/langchain/blob/master/cookbook/oracleai_demo.ipynb uses try/catch blocks which don't print the actual driver or DB error, making it impossible to troubleshoot. For example it currently has:
For any connection failure this will only show:
The code should be changed to:
This, for example, with an incorrect password will show a traceback and a useful error:
The same try/catch problem exists in other examples.
Idea or request for content:
No response