diff options
author | Jakub Sitnicki <jkbs@redhat.com> | 2018-07-07 13:09:35 +0200 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-07-09 15:45:32 -0700 |
commit | 192ab8d8dcb010acdd3f1c4f3eb35432692fe2a6 (patch) | |
tree | 9aad40d0cbd7b5adc2e899a7177cc8c908ee4038 /lib | |
parent | 98af55fce855cc1a7b742d9d7e1830ae0b88aedb (diff) | |
download | openvswitch-192ab8d8dcb010acdd3f1c4f3eb35432692fe2a6.tar.gz |
db-ctl-base: Don't die in cmd_add() on error.
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@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/db-ctl-base.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c index 4af848920..ab35d6333 100644 --- a/lib/db-ctl-base.c +++ b/lib/db-ctl-base.c @@ -1494,11 +1494,12 @@ cmd_add(struct ctl_context *ctx) ovsdb_datum_destroy(&add, type); } if (old.n > type->n_max) { - ctl_fatal("\"add\" operation would put %u %s in column %s of " + ctl_error(ctx, "\"add\" operation would put %u %s in column %s of " "table %s but the maximum number is %u", old.n, type->value.type == OVSDB_TYPE_VOID ? "values" : "pairs", column->name, table->name, type->n_max); + return; } ovsdb_idl_txn_verify(row, column); ovsdb_idl_txn_write(row, column, &old); |