Skip to content

Enhance error handling in RunningObjectTable#12755

Merged
YuliiaKovalova merged 6 commits into
mainfrom
dev/ykovalova/add_more_logging_around_rot
Nov 18, 2025
Merged

Enhance error handling in RunningObjectTable#12755
YuliiaKovalova merged 6 commits into
mainfrom
dev/ykovalova/add_more_logging_around_rot

Conversation

@YuliiaKovalova

Copy link
Copy Markdown
Member

Refactor error handling in GetObject method to provide detailed COM error information when retrieval fails.

Refactor error handling in GetObject method to provide detailed COM error information when retrieval fails.
Added unit tests for Running Object Table error handling and success scenarios.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances error handling in the RunningObjectTable class by replacing a simple Marshal.ThrowExceptionForHR() call with a detailed error reporting mechanism that retrieves and displays COM error information from IErrorInfo when available.

Key changes:

  • Added ThrowComExceptionWithDetails method to construct detailed error messages including HRESULT codes and IErrorInfo details
  • Introduced IErrorInfo COM interface definition and GetErrorInfo P/Invoke declaration
  • Added System and System.Text using directives to support the new functionality
Comments suppressed due to low confidence (1)

src/Build/Instance/RunningObjectTable.cs:116

  • Generic catch clause.
                    catch
                    {
                        // If we can't get error info details, just continue with the basic code.
                    }

Comment thread src/Build/Instance/RunningObjectTable.cs
Comment thread src/Build/Instance/RunningObjectTable.cs Outdated
Comment thread src/Build/Instance/RunningObjectTable.cs Outdated
Comment thread src/Build/Instance/RunningObjectTable.cs Outdated
Comment thread src/Build/Instance/RunningObjectTable.cs Outdated
Comment thread src/Build/Instance/RunningObjectTable.cs
Comment thread src/Build/Instance/RunningObjectTable.cs
Comment thread src/Build/Instance/RunningObjectTable.cs Outdated

@baronfel baronfel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for slicing this out so it's easier to review :)

@YuliiaKovalova YuliiaKovalova merged commit 8636afc into main Nov 18, 2025
10 checks passed
@YuliiaKovalova YuliiaKovalova deleted the dev/ykovalova/add_more_logging_around_rot branch November 18, 2025 14:29
@YuliiaKovalova YuliiaKovalova self-assigned this Dec 2, 2025
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