diff --git a/orchagent/main.cpp b/orchagent/main.cpp index 8d204dbf2d52..03bb5da55031 100644 --- a/orchagent/main.cpp +++ b/orchagent/main.cpp @@ -170,9 +170,17 @@ void getCfgSwitchType(DBConnector *cfgDb, string &switch_type) { Table cfgDeviceMetaDataTable(cfgDb, CFG_DEVICE_METADATA_TABLE_NAME); - if (!cfgDeviceMetaDataTable.hget("localhost", "switch_type", switch_type)) + try { - //Switch type is not configured. Consider it default = "switch" (regular switch) + if (!cfgDeviceMetaDataTable.hget("localhost", "switch_type", switch_type)) + { + //Switch type is not configured. Consider it default = "switch" (regular switch) + switch_type = "switch"; + } + } + catch(const std::system_error& e) + { + SWSS_LOG_ERROR("System error: %s", e.what()); switch_type = "switch"; } @@ -196,64 +204,72 @@ bool getSystemPortConfigList(DBConnector *cfgDb, DBConnector *appDb, vector