New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use common error when removing an unwatched file #37
Conversation
Warning Rate Limit Exceeded@shogo82148 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 36 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe recent modifications in Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (5)
- fsnotify.go (1 hunks)
- inotify.go (1 hunks)
- inotify_test.go (3 hunks)
- kqueue.go (2 hunks)
- windows.go (1 hunks)
Additional comments: 9
fsnotify.go (2)
- 68-68: The updated error message for
ErrNonExistentWatch
is more descriptive and helpful. Good improvement.- 69-69: Prefixing the
ErrEventOverflow
error message withfsnotify:
enhances consistency across error messages in the library. Good change.inotify.go (1)
- 137-137: Using
fmt.Errorf
with the%w
verb to wrapErrNonExistentWatch
in theRemove
function enhances error handling by allowing callers to distinguish this error programmatically. This is a best practice in Go.inotify_test.go (3)
- 11-11: The addition of the
errors
package import is necessary for the updated error handling usingerrors.Is
in tests. This is a good practice for precise error comparison.- 307-308: The modification in error handling in
TestInotifyRemoveTwice
to check for a specific error usingerrors.Is
improves test accuracy and aligns with best practices for error handling.- 390-390: Changing the permission mode representation to octal in
TestInotifyOverflow
improves readability and aligns with conventional Unix/Linux practices.kqueue.go (2)
- 77-77: The change from
var
to:=
for declaringpathsToRemove
improves readability and is more idiomatic Go. This is a good use of type inference.- 110-110: The modification of the error message in the
Remove
function to includeErrNonExistentWatch
aligns with the PR's objective to standardize and improve error messaging. This change makes the error more informative by specifying the type of error and the file name involved, which is beneficial for debugging.windows.go (1)
- 319-319: The modification of the error message in the
remWatch
function to includeErrNonExistentWatch
aligns with the PR's objective to standardize and improve error messaging. This change makes the error more informative by specifying the type of error and the pathname involved, which is beneficial for debugging on Windows platforms.
port of fsnotify/fsnotify#460 The errors returned by the various implementations of the watcher are all different which makes handling them difficult. This PR follows the suggestion in: fsnotify/fsnotify#455 (comment) by @mattn to create a common error which is wrapped by the implementations.
port of fsnotify/fsnotify#460
Summary by CodeRabbit