Skip to content

Handle non-connector failures in queue and Planner samples - #73

Merged
David Burg (daviburg) merged 1 commit into
mainfrom
fix/structured-non-connector-errors
Sep 1, 2026
Merged

Handle non-connector failures in queue and Planner samples#73
David Burg (daviburg) merged 1 commit into
mainfrom
fix/structured-non-connector-errors

Conversation

@daviburg

Copy link
Copy Markdown
Member

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

  • Add catch (Exception ex) when (!ex.IsFatal()) fallbacks to AzureQueuesGetMessagesAsync, PlannerListGroupsAsync, and PlannerListMyTasksAsync.
  • Log the non-fatal exception and return { "success": false, "error": "..." } with HTTP 500, matching adjacent sample handlers.
  • Add one malformed-success-payload regression test for each handler.

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.

Co-authored-by: Dobby <dobby@microsoft.com>
Copilot AI lite review requested due to automatic review settings September 1, 2026 20:14
@daviburg
David Burg (daviburg) requested a review from a team as a code owner September 1, 2026 20:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 to AzureQueuesGetMessagesAsync, PlannerListGroupsAsync, and PlannerListMyTasksAsync.
  • 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.

@daviburg
David Burg (daviburg) merged commit 4d76142 into main Sep 1, 2026
9 checks passed
@daviburg
David Burg (daviburg) deleted the fix/structured-non-connector-errors branch September 1, 2026 21:09
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.

3 participants