Repository navigation
fix: return error when config file cannot be parsed - #574
Open
Sarthak-Shreshtha01 wants to merge 2 commits into
Open
Sarthak-Shreshtha01 wants to merge 2 commits into
Sarthak-Shreshtha01 wants to merge 2 commits into
Conversation
Signed-off-by: Sarthak <sarthakshreshtha345@gmail.com>
Sarthak-Shreshtha01
requested review from
Harsh4902,
lbroudoux and
yada
as code owners
October 8, 2026 11:52
Contributor
|
Hi @Sarthak-Shreshtha01, thank you for submitting this PR! It looks like the review couldn't complete because your GitHub Copilot review quota was reached. Additionally, please make sure to check our contribution guidelines and this issue #559 regarding monthly PR limits before creating a new PR. Thanks again for contributing! |
Harsh4902
requested changes
Oct 9, 2026
Comment on lines
+107
to
+109
| if err != nil { | ||
| return nil, fmt.Errorf("reading config %s: %w", path, err) | ||
| } |
Member
There was a problem hiding this comment.
let's make sure we're using our centralised error handling mechanism.
Comment on lines
+423
to
+425
| if err != nil { | ||
| return nil, fmt.Errorf("reading config %s: %w", path, err) | ||
| } |
ReadLocalConfig and ReadLocalWatchConfig returned a plain fmt.Errorf for a malformed config file instead of going through errors.Wrap like the rest of pkg/*. Per documentation/error-handling.md, a malformed local input file is errors.KindUsage, so wrap it that way and assert the kind in TestReadMalformedConfig. Signed-off-by: Sarthak <sarthakshreshtha345@gmail.com>
Vaishnav88sk
approved these changes
Oct 10, 2026
This branch has not been deployed
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.
ReadLocalConfigandReadLocalWatchConfignow return an error when the config file has invalid YAML, instead of an empty config. Before,logintreated the broken file as a fresh install and overwrote all other contexts. The related tests pass, including the newTestReadMalformedConfig.Fixes #572