Management CLI using try/catch inside if/else

Latest response

Can somebody confirm this for me. I have tried to use a try/catch inside a if/else statement the management cli but it always says the command is not available in the current context. I am assuming this means you cannot embed the try/catch inside a if/else. In the same vein you cannot embed a if/else inside another if/else.

if (outcome == success) of /core-service=management/security-realm=ldap-mngmnt-realm/authentication=ldap:read-resource
    try
        /core-service=management/security-realm=ldap-mngmnt-realm/authentication=ldap:remove
    catch
        /core-service=management/security-realm=ldap-mngmnt-realm/authentication=ldap:remove
    end-try
end-if

Responses