From e85197a8065e6b3bd1309baf38f5fb0946223536 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 29 Jun 2015 13:32:28 +0300 Subject: [PATCH] db: fix std::terminate() called during failed find_schema() One of the find_schema variants calls a find_uuid() that throws out_of_range, without converting it to no_such_column_family first. This results in std::terminate() being called due to exception specifications. Fix by converting the exception. --- database.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/database.cc b/database.cc index 8c255f7cd3..78adf7a192 100644 --- a/database.cc +++ b/database.cc @@ -874,7 +874,11 @@ const column_family& database::find_column_family(const schema_ptr& schema) cons } schema_ptr database::find_schema(const sstring& ks_name, const sstring& cf_name) const throw (no_such_column_family) { - return find_schema(find_uuid(ks_name, cf_name)); + try { + return find_schema(find_uuid(ks_name, cf_name)); + } catch (std::out_of_range&) { + std::throw_with_nested(no_such_column_family(ks_name + ":" + cf_name)); + } } schema_ptr database::find_schema(const utils::UUID& uuid) const throw (no_such_column_family) {