[PR #2302] [MERGED] fix(github_trigger): improve error handling in webhook unsubscribe #2391

Closed
opened 2026-02-16 11:16:51 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-official-plugins/pull/2302
Author: @Mairuis
Created: 12/19/2025
Status: Merged
Merged: 12/21/2025
Merged by: @hjlarry

Base: mainHead: fix/github-trigger-unsubscribe-error-handling


📝 Commits (1)

  • 2127241 fix(github_trigger): improve error handling in webhook unsubscribe

📊 Changes

2 files changed (+31 additions, -26 deletions)

View changed files

📝 triggers/github_trigger/manifest.yaml (+1 -1)
📝 triggers/github_trigger/provider/github.py (+30 -25)

📄 Description

Summary

  • Replace raising UnsubscribeError with returning UnsubscribeResult for graceful error handling
  • Add null-safety check for subscription.properties to prevent potential NoneType errors
  • Add fallback to retrieve repository from parameters if not found in properties
  • Improve error messages to be more descriptive and user-friendly

Background

The previous implementation would raise exceptions when encountering errors during webhook unsubscription, which could cause issues in the trigger management flow. This change makes the error handling more robust by returning result objects instead of throwing exceptions.

Test plan

  • Test unsubscribe with valid webhook
  • Test unsubscribe with missing external_id or repository
  • Test unsubscribe when webhook is already deleted (404 response)
  • Test unsubscribe with network errors

🤖 Generated with Claude Code


🔄 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-official-plugins/pull/2302 **Author:** [@Mairuis](https://github.com/Mairuis) **Created:** 12/19/2025 **Status:** ✅ Merged **Merged:** 12/21/2025 **Merged by:** [@hjlarry](https://github.com/hjlarry) **Base:** `main` ← **Head:** `fix/github-trigger-unsubscribe-error-handling` --- ### 📝 Commits (1) - [`2127241`](https://github.com/langgenius/dify-official-plugins/commit/2127241c45fa06c8b2cfca93e1fdfe6c0ea6350f) fix(github_trigger): improve error handling in webhook unsubscribe ### 📊 Changes **2 files changed** (+31 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `triggers/github_trigger/manifest.yaml` (+1 -1) 📝 `triggers/github_trigger/provider/github.py` (+30 -25) </details> ### 📄 Description ## Summary - Replace raising `UnsubscribeError` with returning `UnsubscribeResult` for graceful error handling - Add null-safety check for `subscription.properties` to prevent potential `NoneType` errors - Add fallback to retrieve repository from `parameters` if not found in `properties` - Improve error messages to be more descriptive and user-friendly ## Background The previous implementation would raise exceptions when encountering errors during webhook unsubscription, which could cause issues in the trigger management flow. This change makes the error handling more robust by returning result objects instead of throwing exceptions. ## Test plan - [x] Test unsubscribe with valid webhook - [x] Test unsubscribe with missing external_id or repository - [x] Test unsubscribe when webhook is already deleted (404 response) - [x] Test unsubscribe with network errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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-16 11:16:51 -05:00
yindo closed this issue 2026-02-16 11:16:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#2391