Skip to content

Commit 7549258

Browse files
authored
Change all throws to SWSS_LOG_THROW (sonic-net#280)
1 parent fd46fbc commit 7549258

File tree

4 files changed

+49
-99
lines changed

4 files changed

+49
-99
lines changed

meta/saiattributelist.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ SaiAttributeList::SaiAttributeList(
2828

2929
if (meta == NULL)
3030
{
31-
SWSS_LOG_ERROR("FATAL: failed to find metadata for object type %d and attr id %d", object_type, attr.id);
32-
throw std::runtime_error("failed to get metadata");
31+
SWSS_LOG_THROW("FATAL: failed to find metadata for object type %d and attr id %d", object_type, attr.id);
3332
}
3433

3534
sai_deserialize_attr_value(str_attr_value, *meta, attr, countOnly);
@@ -69,8 +68,7 @@ std::vector<swss::FieldValueTuple> SaiAttributeList::serialize_attr_list(
6968

7069
if (meta == NULL)
7170
{
72-
SWSS_LOG_ERROR("FATAL: failed to find metadata for object type %d and attr id %d", object_type, attr->id);
73-
throw std::runtime_error("failed to get metadata");
71+
SWSS_LOG_THROW("FATAL: failed to find metadata for object type %d and attr id %d", object_type, attr->id);
7472
}
7573

7674
std::string str_attr_id = sai_serialize_attr_id(*meta);

0 commit comments

Comments
 (0)