Improve error messaging for PowerShell classes that do not implement their declared interface(s) correctly #87
michaeltlombardi
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now, the error message returned from attempting to define a class which does not properly implement its declared interface is not very helpful, as it reports only that the class does not have an implementation of the first missing/incorrect method on the interface(s). It does not identify which interface the method belongs to when there are multiple interfaces or what the signature of the method should be.
Proposal
Given the proposals in #81, #82, #83, #85, and #86, I propose that the error handling for PowerShell classes that do not implement their declared interfaces be improved to enumerate at least what a valid implementation is, if not specifically how the current implementation fails to meet the requirements of the interface.
While my focus here is on improving the authoring experience for DSC Resource developers, this is more broadly applicable to PowerShell developers in general. This also feeds back into DSC Resource development where the developer needs to create a non-DSC Resource class to use as a property of a DSC Resource (it is convenient, for example, to declare a class that implements IComparable).
Beta Was this translation helpful? Give feedback.
All reactions