[PR #90] [MERGED] feat(python): Add specific error classes for StorageInvocation #138

Closed
opened 2026-02-15 21:15:55 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/90
Author: @QuantumGhost
Created: 4/14/2025
Status: Merged
Merged: 4/15/2025
Merged by: @Yeuoly

Base: mainHead: refactor/storage-invocation-exc


📝 Commits (5)

  • b54d8e4 feat(python): Add specific error classes for StorageInvocation
  • f2fe7e3 test(python): Add test cases for StorageInvocation
  • db4fafd chore(python): fix linter violations
  • 7ed3d17 feat(python): Change the exception StorageInvocation.exist raised
  • 865cafa test(python): Add test cases for StorageInvocation.exist.

📊 Changes

2 files changed (+110 additions, -7 deletions)

View changed files

📝 python/dify_plugin/invocations/storage.py (+32 -7)
python/tests/invocations/test_storage.py (+78 -0)

📄 Description

Replace generic Exception raises with NotFoundError when the key is missing,
and StorageInvocationError for other response errors. This improves error
handling at call sites by avoiding overly generic exceptions.

Add correspond tests for exception raising logic.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugin-sdks/pull/90 **Author:** [@QuantumGhost](https://github.com/QuantumGhost) **Created:** 4/14/2025 **Status:** ✅ Merged **Merged:** 4/15/2025 **Merged by:** [@Yeuoly](https://github.com/Yeuoly) **Base:** `main` ← **Head:** `refactor/storage-invocation-exc` --- ### 📝 Commits (5) - [`b54d8e4`](https://github.com/langgenius/dify-plugin-sdks/commit/b54d8e4212ec3ddc22688355be0f6288643b5163) feat(python): Add specific error classes for StorageInvocation - [`f2fe7e3`](https://github.com/langgenius/dify-plugin-sdks/commit/f2fe7e37a99affc97cd0e1e241208c20ae1f5117) test(python): Add test cases for `StorageInvocation` - [`db4fafd`](https://github.com/langgenius/dify-plugin-sdks/commit/db4fafdb57750378c86dc6f9484c3a925d44f397) chore(python): fix linter violations - [`7ed3d17`](https://github.com/langgenius/dify-plugin-sdks/commit/7ed3d1763897f730bb989c7889693adbbbdac23f) feat(python): Change the exception `StorageInvocation.exist` raised - [`865cafa`](https://github.com/langgenius/dify-plugin-sdks/commit/865cafa0dc3bdfcf09227746f1830915a61486bf) test(python): Add test cases for `StorageInvocation.exist`. ### 📊 Changes **2 files changed** (+110 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `python/dify_plugin/invocations/storage.py` (+32 -7) ➕ `python/tests/invocations/test_storage.py` (+78 -0) </details> ### 📄 Description Replace generic `Exception` raises with `NotFoundError` when the key is missing, and `StorageInvocationError` for other response errors. This improves error handling at call sites by avoiding overly generic exceptions. Add correspond tests for exception raising logic. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 21:15:55 -05:00
yindo closed this issue 2026-02-15 21:15:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-sdks#138