diff --git a/src/lib389/lib389/cli_idm/__init__.py b/src/lib389/lib389/cli_idm/__init__.py index 552299820..fc3978a1f 100644 --- a/src/lib389/lib389/cli_idm/__init__.py +++ b/src/lib389/lib389/cli_idm/__init__.py @@ -64,12 +64,7 @@ def _get_basedn_arg(inst, args, log, msg=None): if not DSLdapObject(inst, command_basedn).exists(): errmsg = f'The DN "{command_basedn}" does not exist.' errmsg += f' It is required for "{command_name}" command. Please create it first.' - - if args.json: - sys.stderr.write('{"desc": "%s"}\n' % errmsg) - else: - log.error(errmsg) - sys.exit(1) + raise ValueError(errmsg) except KeyError: pass return basedn_arg