Conversation
| { | ||
| int errorCode = Marshal.GetLastWin32Error(); | ||
| string errorMessage = Marshal.GetLastPInvokeErrorMessage(); | ||
|
|
There was a problem hiding this comment.
@copilot please fix error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace with some tooling (you can run it on everything in this repo)
There was a problem hiding this comment.
Fixed in 0549198 - ran dotnet format whitespace across System.Device.Gpio and manually fixed remaining trailing whitespace in comments.
|
@copilot I resolved conflicts and I probably messed up the PR, please double check all changes are here |
I've verified all changes are present after the merge. ✅ Core changes:
Files with changes:
All |
…essage() Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
… code duplication Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
… helper Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
Co-authored-by: krwq <660048+krwq@users.noreply.github.com>
3358088 to
5141547
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Error messages currently show only numeric errno codes (e.g., "Error 5 performing I2C data transfer"), requiring developers to look up error meanings. This change uses
Marshal.GetLastPInvokeErrorMessage()(.NET 7+) to include descriptive messages.Changes
GetLastErrorMessage()method that captures both error code and message, formats as"code (message)"Example
Before:
After:
Notes
Three locations manually format errors where error code must be checked before throwing (EINTR/ENOENT comparisons). These are documented with inline comments explaining why
GetLastWin32Error()cannot be called twice.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Microsoft Reviewers: Open in CodeFlow