fix(envd): clean up error formatting when watch path is not a directory - #3582
Open
chill-czar wants to merge 1 commit into
Open
fix(envd): clean up error formatting when watch path is not a directory#3582chill-czar wants to merge 1 commit into
chill-czar wants to merge 1 commit into
Conversation
chill-czar
requested review from
ValentaTomas,
dobrac and
jakubno
as code owners
August 17, 2026 19:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3581
Summary
%wformatting verb onnilerror inpackages/envd/internal/services/filesystem/watch.goandwatch_sync.gowhen the requested watch path is not a directory.path <path> is not a directoryinstead ofpath <path> not a directory: %!w(<nil>).TestCreateWatcher_NotADirectoryinpackages/envd/internal/services/filesystem/watch_test.goasserting clean error strings without%!w.Why
In
watch.goandwatch_sync.go, whenos.Statsucceeds for a non-directory path,errisnil. Callingfmt.Errorf("path %s not a directory: %w", watchPath, err)resulted in%!w(<nil>)being appended to the error string returned across the Connect-RPC wire and emitted in server logs.Diff Overview
if !info.IsDir() { - return connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("path %s not a directory: %w", watchPath, err)) + return connect.NewError(connect.CodeInvalidArgument, fmt.Errorf("path %s is not a directory", watchPath)) }Test Plan
go test -v ./packages/envd/internal/services/filesystem -run TestCreateWatcher_NotADirectorygo test -v ./packages/envd/internal/services/filesystem/...make fmtandmake lint"is not a directory"and does not contain"%!w"/cc @jakubno @dobrac @ValentaTomas @arkamar @tvi