refs #815 Mark with \todo the remaining places where CJsonException needs to be caught.

This commit is contained in:
Mathew Sutcliffe
2016-12-21 02:28:19 +00:00
parent 51c3ae8c25
commit bda0f42c60
5 changed files with 11 additions and 11 deletions

View File

@@ -61,7 +61,7 @@ namespace BlackCore
if (!airportsJson.isEmpty())
{
CAirportList airports;
airports.convertFromJson(airportsJson);
airports.convertFromJson(airportsJson); //! \todo catch CJsonException or use convertFromJsonNoThrow
const int c = airports.size();
this->m_airportCache.set(airports);

View File

@@ -314,7 +314,7 @@ namespace BlackCore
if (!countriesJson.isEmpty())
{
CCountryList countries;
countries.convertFromJson(Json::jsonObjectFromString(countriesJson));
countries.convertFromJson(Json::jsonObjectFromString(countriesJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
const int c = countries.size();
this->m_countryCache.set(countries);
@@ -330,7 +330,7 @@ namespace BlackCore
if (!aircraftJson.isEmpty())
{
CAircraftIcaoCodeList aircraftIcaos;
aircraftIcaos.convertFromJson(Json::jsonObjectFromString(aircraftJson));
aircraftIcaos.convertFromJson(Json::jsonObjectFromString(aircraftJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
const int c = aircraftIcaos.size();
this->m_aircraftIcaoCache.set(aircraftIcaos);
@@ -345,7 +345,7 @@ namespace BlackCore
if (!airlineJson.isEmpty())
{
CAirlineIcaoCodeList airlineIcaos;
airlineIcaos.convertFromJson(Json::jsonObjectFromString(airlineJson));
airlineIcaos.convertFromJson(Json::jsonObjectFromString(airlineJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
const int c = airlineIcaos.size();
this->m_airlineIcaoCache.set(airlineIcaos);
reallyRead |= CEntityFlags::AirlineIcaoEntity;

View File

@@ -387,7 +387,7 @@ namespace BlackCore
if (!liveriesJson.isEmpty())
{
CLiveryList liveries;
liveries.convertFromJson(liveriesJson);
liveries.convertFromJson(liveriesJson); //! \todo catch CJsonException or use convertFromJsonNoThrow
const int c = liveries.size();
this->m_liveryCache.set(liveries);
@@ -402,7 +402,7 @@ namespace BlackCore
if (!modelsJson.isEmpty())
{
CAircraftModelList models;
models.convertFromJson(Json::jsonObjectFromString(modelsJson));
models.convertFromJson(Json::jsonObjectFromString(modelsJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
const int c = models.size();
this->m_modelCache.set(models);
@@ -417,7 +417,7 @@ namespace BlackCore
if (!distributorsJson.isEmpty())
{
CDistributorList distributors;
distributors.convertFromJson(Json::jsonObjectFromString(distributorsJson));
distributors.convertFromJson(Json::jsonObjectFromString(distributorsJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
const int c = distributors.size();
this->m_distributorCache.set(distributors);

View File

@@ -280,7 +280,7 @@ namespace BlackCore
QString content(CFileUtils::readFileToString(fn));
if (content.isEmpty()) { return false; }
CGlobalSetup s;
s.convertFromJson(content);
s.convertFromJson(content); //! \todo catch CJsonException or use convertFromJsonNoThrow
s.setDevelopment(true);
m_setup.set(s);
return true;
@@ -311,7 +311,7 @@ namespace BlackCore
{
const CGlobalSetup currentSetup = m_setup.get();
CGlobalSetup loadedSetup;
loadedSetup.convertFromJson(Json::jsonObjectFromString(setupJson));
loadedSetup.convertFromJson(Json::jsonObjectFromString(setupJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
loadedSetup.markAsLoaded(true);
if (lastModified > 0 && lastModified > loadedSetup.getMSecsSinceEpoch()) { loadedSetup.setMSecsSinceEpoch(lastModified); }
bool sameVersionLoaded = (loadedSetup == currentSetup);
@@ -384,7 +384,7 @@ namespace BlackCore
{
CUpdateInfo currentUpdateInfo(m_updateInfo.get()); // from cache
CUpdateInfo loadedUpdateInfo;
loadedUpdateInfo.convertFromJson(Json::jsonObjectFromString(setupJson));
loadedUpdateInfo.convertFromJson(Json::jsonObjectFromString(setupJson)); //! \todo catch CJsonException or use convertFromJsonNoThrow
if (lastModified > 0 && lastModified > loadedUpdateInfo.getMSecsSinceEpoch()) { loadedUpdateInfo.setMSecsSinceEpoch(lastModified); }
const bool sameVersionLoaded = (loadedUpdateInfo == currentUpdateInfo);
if (sameVersionLoaded)

View File

@@ -1327,7 +1327,7 @@ namespace BlackGui
break;
}
ContainerType container;
container.convertFromJson(json);
container.convertFromJson(json); //! \todo catch CJsonException or use convertFromJsonNoThrow
m = this->modifyLoadedJsonData(container);
if (m.isFailure()) { break; } // modification error
m = this->validateLoadedJsonData(container);