avoid exceptions
This commit is contained in:
@ -1 +1 @@
|
||||
target_sources(${LIB_EIVE_MISSION} PRIVATE NVMParameterBase.cpp)
|
||||
target_sources(${LIB_EIVE_MISSION} PRIVATE NvmParameterBase.cpp)
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "NVMParameterBase.h"
|
||||
#include <mission/memory/NvmParameterBase.h>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
@ -10,7 +10,8 @@ NVMParameterBase::NVMParameterBase(std::string fullName) : fullName(fullName) {}
|
||||
NVMParameterBase::NVMParameterBase() {}
|
||||
|
||||
ReturnValue_t NVMParameterBase::readJsonFile() {
|
||||
if (std::filesystem::exists(fullName)) {
|
||||
std::error_code e;
|
||||
if (std::filesystem::exists(fullName, e)) {
|
||||
// Read JSON file content into object
|
||||
std::ifstream i(fullName);
|
||||
try {
|
||||
@ -39,7 +40,10 @@ void NVMParameterBase::setFullName(std::string fullName) { this->fullName = full
|
||||
|
||||
std::string NVMParameterBase::getFullName() const { return fullName; }
|
||||
|
||||
bool NVMParameterBase::getJsonFileExists() { return std::filesystem::exists(fullName); }
|
||||
bool NVMParameterBase::getJsonFileExists() {
|
||||
std::error_code e;
|
||||
return std::filesystem::exists(fullName, e);
|
||||
}
|
||||
|
||||
void NVMParameterBase::printKeys() const {
|
||||
sif::info << "Printing keys for JSON file " << fullName << std::endl;
|
Reference in New Issue
Block a user