[ovs-dev] [PATCH 23/23] db-ctl-base: Don't die in cmd_destroy() on error.
Jakub Sitnicki
jkbs at redhat.com
Mon Jul 2 10:50:19 UTC 2018
Return the error via the context instead of calling ctl_fatal() so that
the caller can decide how to handle it.
Signed-off-by: Jakub Sitnicki <jkbs at redhat.com>
---
lib/db-ctl-base.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c
index f5492aadb..bfec8257a 100644
--- a/lib/db-ctl-base.c
+++ b/lib/db-ctl-base.c
@@ -1785,11 +1785,15 @@ cmd_destroy(struct ctl_context *ctx)
}
if (delete_all && ctx->argc > 2) {
- ctl_fatal("--all and records argument should not be specified together");
+ ctl_error(ctx, "--all and records argument should not be specified "
+ "together");
+ return;
}
if (delete_all && !must_exist) {
- ctl_fatal("--all and --if-exists should not be specified together");
+ ctl_error(ctx, "--all and --if-exists should not be specified "
+ "together");
+ return;
}
if (delete_all) {
--
2.14.4
More information about the dev
mailing list