fix error on window. replace error msg check by error code check#345
Merged
fix error on window. replace error msg check by error code check#345
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes error handling on Windows by replacing error message string checks with error code checks using a new sentinel error. The change improves cross-platform compatibility by avoiding platform-specific error message text matching.
Changes:
- Introduced a new error package with a sentinel error
ErrNetworkConfigfor consistent error checking - Replaced error message string matching with
errors.Is()checks for network configuration failures - Added a new method
SetLastErrorIfEqualfor conditional error state updates - Updated golangci-lint configuration version
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| server/pkg/error/error.go | New error package defining ErrNetworkConfig sentinel error |
| server/int/api/config/config.go | Updated error returns to use sentinel error instead of wrapped errors |
| plugin/int/server/config.go | Replaced string-based error checking with errors.Is() check |
| plugin/int/station/networkManager.go | Added error reset logic and fixed log parameter order |
| plugin/int/server/manager.go | Added SetLastErrorIfEqual method for conditional error updates |
| plugin/home/src/Status.tsx | Whitespace formatting change only |
| plugin/home/package-lock.json | Dependency version updates |
| server/.golangci.yml | Updated golangci-lint version to 2.3 |
| plugin/manifest.json | Version bump from 0.4.9 to 0.4.10 |
Files not reviewed (1)
- plugin/home/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
plugin/int/station/networkManager.go:122
- The documentation comment uses JavaDoc-style @param tags, which is not idiomatic for Go. Go documentation should use plain English without special tags.
/*
Retrieve current network information from station and update the deweb
server config file if the node url is not the same.
If the node name has changed, the node name will be updated in the cache (there is no node name in config).
@param restartServer if true, the server will be restarted with the new network url. Else, only the server config will be updated.
*/
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Soulthym
approved these changes
Jan 20, 2026
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.
No description provided.