Title: Message Title
Henrik Lindberg commented on PUP-10399
Re: Error: wrong number of arguments (given 2, expected 1) Deferred function doesn't return file / line number
Hm, that is bad and something I did not think about when implementing the support for Deferred. The problem here is that the file/line is not included in the serialization of the deferred value into the catalog. Thus when it is resolved (i.e. called) on the agent side it has lost all of the context in which it was created. To fix this, when an instance of Deferred is created it needs to look on the puppet stack to get the caller's location. These two values must then be encoded in the Deferred instance, and then serialized. Then the logic that performs the call must make use of the file/line information which probably involves catch and re-raise-or-wrap depending on type of error being raised. Since this affects the serialization a decision to include file/line must depend on what the agent accepts. A compromise could be to show file/line for the resource attribute for which the deferred is resolved (IIRC those are available in the catalog). This may not be correct if the deferred is nested in some other structure, but perhaps better than nothing. Doing that would not require messing with the serialization protocol.
Add Comment
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
--
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To view this discussion on the web visit