Fix issue with extension errors not being printed when using ReportError()#6900
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a host-rendering gap in the extension structured error transport so that “plain” (untyped) extension errors reported via ReportError() still surface correctly in azd’s UX/telemetry pipelines.
Changes:
- Update
UnwrapErrorto convert unspecified/untypedExtensionErrormessages into*azdext.LocalError(categorylocal) instead of a genericerrors.New(...). - Extend round-trip tests to assert untyped errors unwrap as
LocalErrorand preserve message/category.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cli/azd/pkg/azdext/extension_error.go | Changes default UnwrapError behavior so untyped extension errors become LocalError(local) for host UX/telemetry extraction. |
| cli/azd/pkg/azdext/extension_error_test.go | Adds assertions validating that untyped errors round-trip as LocalError with preserved message and local category. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Co-authored-by: rajeshkamal5050 <11532743+rajeshkamal5050@users.noreply.github.com>
This PR fixes a bug from #6835 where extension custom commands returning plain
fmt.Errorf(...)errors didn't output the error when usingReportError().