Skip to content

Handle permission errors explicitly in readConfigFile#10568

Open
NasitSony wants to merge 1 commit into
temporalio:mainfrom
NasitSony:fix-permission-error-config-files
Open

Handle permission errors explicitly in readConfigFile#10568
NasitSony wants to merge 1 commit into
temporalio:mainfrom
NasitSony:fix-permission-error-config-files

Conversation

@NasitSony

Copy link
Copy Markdown

When os.ReadFile fails due to permission denied, return a specific error message instead of the generic 'could not read config file' message. This makes permission issues immediately identifiable without needing to inspect the wrapped error.

Fixes #7048

What changed?

Added explicit handling for os.ErrPermission in readConfigFile
to return a clear, specific error message when a config file cannot
be read due to permission issues.

Why?

Permission errors were wrapped in a generic "could not read config
file" message, making it hard to distinguish permission issues from
other read errors. Now permission errors return a specific
"permission denied reading config file" message that immediately
identifies the root cause.

How did you test it?

  • ✅ built
  • ✅ covered by existing tests

Potential risks

None — additive error handling only. No behavior change for
non-permission errors. Permission denied errors now return a
more descriptive message instead of the generic one.

When os.ReadFile fails due to permission denied, return a specific
error message instead of the generic 'could not read config file'
message. This makes permission issues immediately identifiable
without needing to inspect the wrapped error.

Fixes temporalio#7048
@NasitSony NasitSony requested review from a team as code owners June 5, 2026 22:05
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.

Handle Permission Errors in getConfigFiles Function

1 participant