EliziumNet/Loopz

Rename-Many: Exception occurs when anchor fails match

Closed this issue · 2 comments

Sancho@JANUS  ~\dev\tree  [20:32]

λ gci $dir | remy -Pattern '(?\d{4})-(?\d{2})-(?\d{2}) -' -Anchor '(x?\d{2})' -Paste ' (${y}-${m}-${d}) ${_a}' -WhatIf
[😍] ----------------------------------------------------------------------------------------------------- [ Rename ] ---
Exception calling "InvokeReturnAsIs" with "4" argument(s): "Cannot convert the "System.Object[]" value of type "System.Object[]" to type "couplet"."
⨯ Sancho@JANUS  ~\dev\tree  [20:32]

The exception handler should show show the error

This was caused by a bad signal definition as a custom override in profile:

'NOT-ACTIONED' = @('Not Actioned', '🥀');

which should be:
'NOT-ACTIONED' = (kp(@('Not Actioned', '🥀')));

can be avoided by using Update-CustomSignals, which validates signal entries.

However, we still need an update to show the call stack and exception message if ever an error occurs.