-
Notifications
You must be signed in to change notification settings - Fork 29
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
Changed List operation errors to non-terminating warnings #135
Conversation
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.
We should discuss the fundamental design so that it's more general and not specific to command discovery init
@@ -15,6 +15,7 @@ use std::path::Path; | |||
pub struct CommandDiscovery { | |||
pub resources: BTreeMap<String, DscResource>, | |||
provider_resources: Vec<String>, | |||
initialization_messages: Vec<StreamMessage>, |
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.
I don't think this should be a member of this struct. I was imaging we'd have a new log
struct that everything calls and would handle output to STDERR and also if it's emitted as JSON or text. This would replace all direct calls to eprint
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.
yes, new log struct that everything calls and would handle output to STDERR and also if it's emitted as JSON or text
- that is on todo list. Current eprintln
calls will later be refactored to calling that new API.
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.
the problem with calling logging functions (eprintln's fow now; new 'log' API later) right as messages are generated is that we change message types depending on what higher level operation is executing. Which means this logic has to be somehow passed to the 'log', which complicates things.
In any way, these 2 are just different implementation approaches that we can switch between later if we won't like this one; the user will have the same UX in both cases.
PR Summary
This fixes
List
part of #121 :if part of dsc resource list, we can emit a warning type message to stderr but continue discovery listing the results
Example output after the fix: