Active IQ Unified Manager Discussions

WFA 2.1 RC bug report

igorf

In the command "cm_storage / Create volume" the following code will not be able to catch any exceptions:

try
{
    Invoke-Expression $expression -ErrorAction stop
}
catch
{
  throw "Failed to create new volume: " + $VolumeName + ". Message: " + $_.Exception.Message
}

An exception eventually happens while attempt to set volume options for the volume which does not exist.

This code will cause the loss of valuable diagnostics about why volume was not created.

It also causes confusion on set options calls.

Proposed quick fix:

try
{
    $erroractionpreference = "Stop"
    Invoke-Expression $expression -ErrorAction stop
}
catch
{
    throw "Failed to create new volume: " + $VolumeName + ". Message: " + $_.Exception.Message
}

3 REPLIES 3

kiessl

Hi,

very interesting.

I had a similar issue where the "try ... catch" block would not catch any exceptions. Instead the exception were raised at the end of the command execution in the workflow.

Is this quickfix a general possibility to make the try...catch work or a special case for the statement above (sorry, I'm no powershell guru).

Best Regards

Walter

igorf

This seems limited to Invoke-Expression. I'm not powershell guru either

shailaja

Thanks for reporting. We have filed an internal bug to track the same.

Shailaja

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public