The errors returned by the module contain a good text (returned by the server), but it doesn't show where the error happened.
It shows the point in the internal functions where the module got the error from the server
Possible Solution
Have the $PSCmdlet from the calling script pass down to the internals and use $PSCmdlet.ThrowError() to write to the error stream.
The following internal functions would be helpful (source):
Expected Behavior
The errors returned by the module are meaningful
Current Behavior
The errors returned by the module contain a good text (returned by the server), but it doesn't show where the error happened. It shows the point in the internal functions where the module got the error from the server
Possible Solution
Have the
$PSCmdlet
from the calling script pass down to the internals and use$PSCmdlet.ThrowError()
to write to the error stream.The following internal functions would be helpful (source):
Things to consider:
$CallerPSCmdlet
parameter as well in case a function call another function? as in: https://github.com/AtlassianPS/JiraPS/blob/master/JiraPS/Public/Add-JiraGroupMember.ps1#L102