Skip to content

[CORE]: Improve filesystem error messages during Linux device discovery#27289

Open
theHamsta wants to merge 2 commits intomicrosoft:mainfrom
theHamsta:sseitz/better-error-message-ErrorCodeToStatus
Open

[CORE]: Improve filesystem error messages during Linux device discovery#27289
theHamsta wants to merge 2 commits intomicrosoft:mainfrom
theHamsta:sseitz/better-error-message-ErrorCodeToStatus

Conversation

@theHamsta
Copy link
Contributor

Description

This is a follow-up to #26210
to address #26210 (comment) and review dog lints.

ErrorCodeToStatus currently does not include the filesystem path that
caused the error. This could it make difficult to know the root cause
of a reported filesystem error.

Review dog lints: https://github.com/microsoft/onnxruntime/pull/26210/changes
Plus a typo: dit -> did

Motivation and Context

Clean up discussed issues and lints of #26210

ErrorCodeToStatus currently does not include the filesystem path that
caused the error. This could it make difficult to know the root cause
of a reported filesystem error.
namespace {

Status ErrorCodeToStatus(const std::error_code& ec) {
Status ErrorCodeToStatus(const std::error_code& ec, const fs::path& path, std::string_view context) {
Copy link
Contributor Author

@theHamsta theHamsta Feb 9, 2026

Choose a reason for hiding this comment

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

the string "context" could be overkill. I thought it would provide useful context, why we accessed the file. But I would at least include the filesystem path that caused the error code. Otherwise, debugging the error code could be difficult

@theHamsta theHamsta changed the title Sseitz/better error message error code to status [CORE]: Address review dog lints in microsoft#26210 (Linux device discovery) Feb 9, 2026
@theHamsta theHamsta changed the title [CORE]: Address review dog lints in microsoft#26210 (Linux device discovery) [CORE]: Improve filesystem error messages during Linux device discovery Feb 9, 2026
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.

1 participant