-
Notifications
You must be signed in to change notification settings - Fork 983
Open
Labels
Milestone
Description
- Program: dnsdist
- Issue type: Feature request
Short description
I was holding setPoolServerPolicy wrong, and the error message didn't help me.
Usecase
Making runtime config changes before coffee.
Description
> setPoolServerPolicy("poolname", leastOutstanding)
Error: Unable to convert parameter from string to St10shared_ptrI12ServerPolicyE
stack traceback:
[C]: at 0xaaaacfa7ab04
> leastOutstanding
Command returned an object we can't print: Trying to cast a lua variable from "userdata" to "N5boost8optionalINS_7variantINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJSt10shared_ptrI15DownstreamStateEP11ClientStateSt13unordered_mapIS7_dSt4hashIS7_ESt8equal_toIS7_ESaISt4pairIKS7_dEEEEEEEE"
> setPoolServerPolicy("poolname", "leastOutstanding")
Error: Unable to convert parameter from string to St10shared_ptrI12ServerPolicyE
stack traceback:
[C]: at 0xaaaacfa7ab04>
After @pieterlexis helped me:
> setPoolServerPolicy(leastOutstanding, "nextdns")
So what I think would have helped me:
- Instead of "Error: Unable to convert parameter from string to St10shared_ptrI12ServerPolicyE" print something like "Error: Unable to convert parameter 2 from string to St10shared_ptrI12ServerPolicyE" - show the parameter position that failed
- make builtin objects like leastOutstanding printable. Just "Builtin ServerPolicy leastOutstanding" would already be super useful.
Additionally it would be nice if functions named set<ThingA><ThingB> would take parameters in order <ThingA> <ThingB> and not the other way round.
Reactions are currently unavailable