Skip to content

feat: improve error handling with custom exceptions and troubleshooting guide#64

Open
knqiufan wants to merge 3 commits intooceanbase:mainfrom
knqiufan:feat/improve-error-handling
Open

feat: improve error handling with custom exceptions and troubleshooting guide#64
knqiufan wants to merge 3 commits intooceanbase:mainfrom
knqiufan:feat/improve-error-handling

Conversation

@knqiufan
Copy link

Summary

This PR enhances error handling across the langchain-oceanbase project by introducing a custom exception hierarchy and adding actionable troubleshooting hints to help users diagnose and resolve issues quickly.

close #45

Dependencies

  • Depends on #XX (PR 1: LangGraph Checkpointer)

Changes

1. Custom exception hierarchy (langchain_oceanbase/exceptions.py)

  • OceanBaseError - Base exception
  • OceanBaseConnectionError - Connection failures with host/port info
  • OceanBaseVectorDimensionError - Dimension mismatch with expected/actual values
  • OceanBaseIndexError - Index operation failures
  • OceanBaseVersionError - Version compatibility issues
  • OceanBaseConfigurationError - Invalid configuration with valid values hint

2. Improved error messages in:

  • vectorstores.py - Parameter validation, feature enablement hints
  • ai_functions.py - Version requirements, model configuration hints
  • checkpointer.py - Connection error handling

3. Troubleshooting section in README.md

  • Connection Refused
  • Vector Dimension Mismatch
  • Index Creation Failed
  • AI Functions Not Supported
  • Slow Queries
  • Sparse Vector / Full-text Search Not Working
  • Import Errors

4. Unit tests (tests/unit_tests/test_exceptions.py)

  • Exception inheritance and message format
  • Attribute storage
  • Troubleshooting URL presence

…nd improve SQL syntax in checkpointer.py for clarity and consistency
…g in OceanBase integration

- Introduced a comprehensive troubleshooting section in README.md covering common connection issues, vector dimension mismatches, index creation failures, and AI function support.
- Enhanced error handling in the OceanBase integration by replacing generic ValueErrors with specific OceanBase exceptions for better clarity and debugging.
- Updated exception handling in the OceanBaseCheckpointSaver and OceanbaseVectorStore classes to provide more informative error messages.
@xxsc0529
Copy link
Contributor

@knqiufan Thank you for your contribution. Can you resolve the PR conflict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error messages with troubleshooting hints

2 participants