> And finally, I'm not seeing why the dodge with the context thread var is
>> needed.  Isn't this just going to be the current AST node?
>>
>>
>
> Yes. But from lookupvar, we don't know what the current AST node is (as far
> as I could find). The goal is simply to find the current line and file,
> preferably from something that mixes in Util::Errors, so we can use
> error_context. If there's somewhere more correct to get that information
> from lookupvar, I would like to fix it, as it's a rather inelegant solution
> now.
>

So two ideas:

1) The obvious idea would be to pass it in to lookupvar from the call site
(which should know the context), or if you'd rather think outside the box
2) conditionally raise an exception when you detect the error and move the
warning logic into safeevaluate, with a "retry" to resume after the message
is generated.

The first has the advantage of no magic and the second has the advantage of
locality.

-- M
-----------------------------------------------------------
The power of accurate observation is
commonly called cynicism by those
who have not got it.  ~George Bernard Shaw
------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to