another small improvement

This commit is contained in:
Robin Müller 2021-01-08 15:15:02 +01:00
parent f2ecd6d740
commit 541478e4d5
2 changed files with 10 additions and 16 deletions

View File

@ -3,10 +3,8 @@
#include "LocalPoolDataSetBase.h"
#include "../housekeeping/HousekeepingPacketUpdate.h"
#include "../serviceinterface/ServiceInterface.h"
#include "../housekeeping/HousekeepingSetPacket.h"
#include "../housekeeping/AcceptsHkPacketsIF.h"
#include "../timemanager/CCSDSTime.h"
#include "../ipc/MutexFactory.h"
#include "../ipc/MutexHelper.h"
@ -835,6 +833,12 @@ void LocalDataPoolManager::printWarningOrError(ErrorTypes errorType,
else if(error == QUEUE_OR_DESTINATION_INVALID) {
errorPrint = "Queue or destination not set";
}
else if(error == HasLocalDataPoolIF::POOL_ENTRY_TYPE_CONFLICT) {
errorPrint = "Pool entry type conflict";
}
else if(error == HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND) {
errorPrint = "Pool entry not found";
}
else {
errorPrint = "Unknown error";
}

View File

@ -387,25 +387,15 @@ ReturnValue_t LocalDataPoolManager::fetchPoolEntry(lp_id_t localPoolId,
PoolEntry<T> **poolEntry) {
auto poolIter = localPoolMap.find(localPoolId);
if (poolIter == localPoolMap.end()) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "HousekeepingManager::fetchPoolEntry: Pool entry "
"not found." << std::endl;
#else
fsfw::printWarning("HousekeepingManager::fetchPoolEntry: Pool entry "
"not found.\n");
#endif
printWarningOrError(ErrorTypes::ERROR_TYPE, "fetchPoolEntry",
HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND);
return HasLocalDataPoolIF::POOL_ENTRY_NOT_FOUND;
}
*poolEntry = dynamic_cast< PoolEntry<T>* >(poolIter->second);
if(*poolEntry == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "HousekeepingManager::fetchPoolEntry:"
" Pool entry type conflict." << std::endl;
#else
fsfw::printWarning("HousekeepingManager::fetchPoolEntry:"
" Pool entry type conflict.\n");
#endif
printWarningOrError(ErrorTypes::ERROR_TYPE, "fetchPoolEntry",
HasLocalDataPoolIF::POOL_ENTRY_TYPE_CONFLICT);
return HasLocalDataPoolIF::POOL_ENTRY_TYPE_CONFLICT;
}
return HasReturnvaluesIF::RETURN_OK;