Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • Management CLI using try/catch inside if/else

    Posted on

    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
    

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat