From: Stefan Metzmacher Date: Tue, 5 Nov 2019 10:23:48 +0000 (+0100) Subject: python/netcmd/dns: improve exception handling in cmd_delete_record() X-Git-Tag: ldb-2.2.0~1190 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23bd1eff751fad67a5caacd9fbc2911cd85f8e49;p=thirdparty%2Fsamba.git python/netcmd/dns: improve exception handling in cmd_delete_record() Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/python/samba/netcmd/dns.py b/python/samba/netcmd/dns.py index 6cf8d40b2aa..330e2efbdcd 100644 --- a/python/samba/netcmd/dns.py +++ b/python/samba/netcmd/dns.py @@ -1067,7 +1067,9 @@ class cmd_delete_record(Command): del_rec_buf) except WERRORError as e: if e.args[0] == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST: - raise CommandError('Zone does not exist; record could not be deleted.') + raise CommandError('Zone does not exist; record could not be deleted. zone[%s] name[%s]' % (zone, name)) + if e.args[0] == werror.WERR_DNS_ERROR_RECORD_DOES_NOT_EXIST: + raise CommandError('Record does not exist; record could not be deleted. zone[%s] name[%s]' % (zone, name)) raise e self.outf.write('Record deleted successfully\n')