langchain/libs
junkeon 4fda7bf4f2
upstage[patch] : fix error handling in Layout Analysis parser (#22054)
This pull request addresses and fixes exception handling in the
UpstageLayoutAnalysisParser and enhances the test coverage by adding
error exception tests for the document loader. These improvements ensure
robust error handling and increase the reliability of the system when
dealing with external API calls and JSON responses.

### Changes Made
1. Fix Request Exception Handling:

- Issue: The existing implementation of UpstageLayoutAnalysisParser did
not properly handle exceptions thrown by the requests library, which
could lead to unhandled exceptions and potential crashes.
- Solution: Added comprehensive exception handling for
requests.RequestException to catch any request-related errors. This
includes logging the error details and raising a ValueError with a
meaningful error message.

2. Add Error Exception Tests for Document Loader:

- New Tests: Introduced new test cases to verify the robustness of the
UpstageLayoutAnalysisLoader against various error scenarios. The tests
ensure that the loader gracefully handles:
- RequestException: Simulates network issues or invalid API requests to
ensure appropriate error handling and user feedback.
- JSONDecodeError: Simulates scenarios where the API response is not a
valid JSON, ensuring the system does not crash and provides clear error
messaging.
2024-05-23 11:45:34 -04:00
..
cli infra: rm unused # noqa violations (#22049) 2024-05-22 15:21:08 -07:00
community community[minor]: Added propagation of document metadata from O365BaseLoader (#20663) 2024-05-23 11:42:19 -04:00
core infra: rm unused # noqa violations (#22049) 2024-05-22 15:21:08 -07:00
experimental infra: rm unused # noqa violations (#22049) 2024-05-22 15:21:08 -07:00
langchain infra: rm unused # noqa violations (#22049) 2024-05-22 15:21:08 -07:00
partners upstage[patch] : fix error handling in Layout Analysis parser (#22054) 2024-05-23 11:45:34 -04:00
standard-tests core, standard tests, partner packages: add test for model params (#21677) 2024-05-17 13:51:26 -04:00
text-splitters text-splitters[patch]: Extend TextSplitter:keep_separator functionality (#21130) 2024-05-22 13:17:45 -07:00