Handle non-connector failures in queue and Planner samples - #73
Merged
Merged
Conversation
Co-authored-by: Dobby <dobby@microsoft.com>
There was a problem hiding this comment.
🟢 Approval recommended
The added fallback handlers align with existing repository patterns for non-fatal exception handling and are covered by targeted regression tests.
Pull request overview
This PR hardens the sample Azure Functions for Azure Queues and Microsoft Planner so that non-connector exceptions (e.g., malformed “successful” payloads that fail deserialization) are handled consistently by returning the standard structured HTTP 500 response, and adds regression tests to cover these cases.
Changes:
- Add
catch (Exception ex) when (!ex.IsFatal())fallbacks toAzureQueuesGetMessagesAsync,PlannerListGroupsAsync, andPlannerListMyTasksAsync. - Log non-fatal exceptions and return
{ success: false, error: "..." }with HTTP 500 for malformed success payload scenarios. - Add one regression test per handler to validate the structured 500 behavior.
File summaries
| File | Description |
|---|---|
| DirectConnector/PlannerFunctions.cs | Adds non-fatal exception fallback handling to return structured HTTP 500 responses for Planner endpoints. |
| DirectConnector/AzureQueuesFunctions.cs | Adds non-fatal exception fallback handling to return structured HTTP 500 responses for the queue message receive sample. |
| DirectConnector.Tests/PlannerFunctionsTests.cs | Adds regression tests asserting structured HTTP 500 responses on malformed “success” payloads for Planner endpoints. |
| DirectConnector.Tests/AzureQueuesFunctionsTests.cs | Adds regression test asserting structured HTTP 500 response on malformed “success” payload for Azure Queues message receive. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Swapnil Nagar (swapnil-nagar)
approved these changes
Sep 1, 2026
David Burg (daviburg)
deleted the
fix/structured-non-connector-errors
branch
September 1, 2026 21:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Handle non-connector failures in the Azure Queues message-receive sample and both Microsoft Planner endpoints so malformed successful connector payloads return the samples' standard structured HTTP 500 response.
Follow-up to PR #72 review 5082440200, whose approved review identified these post-merge items.
Changes
catch (Exception ex) when (!ex.IsFatal())fallbacks toAzureQueuesGetMessagesAsync,PlannerListGroupsAsync, andPlannerListMyTasksAsync.{ "success": false, "error": "..." }with HTTP 500, matching adjacent sample handlers.Validation
dotnet test DirectConnector.Tests/DirectConnector.Tests.csproj --configuration Release --filter "FullyQualifiedName~AzureQueuesFunctionsTests|FullyQualifiedName~PlannerFunctionsTests": 12 passed, 0 failed.dotnet test Connectors-NET-Samples.sln --configuration Release: 79 passed, 0 failed.dotnet format Connectors-NET-Samples.sln --verify-no-changes --no-restore: passed.