Skip to content

Commit

Permalink
Change all throws to SWSS_LOG_THROW (sonic-net#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored Jan 12, 2018
1 parent fd46fbc commit 7549258
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 99 deletions.
6 changes: 2 additions & 4 deletions meta/saiattributelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ SaiAttributeList::SaiAttributeList(

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

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

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

std::string str_attr_id = sai_serialize_attr_id(*meta);
Expand Down
Loading

0 comments on commit 7549258

Please sign in to comment.