Handlers: removing nonexistent tag is not an error

This commit is contained in:
rr- 2016-03-17 08:00:45 +01:00
parent 7b616aa671
commit 8e9204420b
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ bool RemovalTagsHandler::edit_impl(Tags &tags)
return anything_removed;
} else {
if (!tags.contains(tag_key))
throw TagDoesNotExistError(tag_key);
return false;
tags.remove(tag_key);
return true;

View File

@ -22,7 +22,7 @@ TEST_CASE("removal tags handler", "[tags_handlers]")
REQUIRE(handler.edit(streamno, tags));
REQUIRE(tags.get_all().size() == 1);
REQUIRE(tags.contains(other_tag_key));
REQUIRE_THROWS(handler.edit(streamno, tags));
REQUIRE(!handler.edit(streamno, tags));
}
SECTION("removing all tags")