From e626841dbe7ed4043cbc75115c4ae71a6ce3babc Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 24 Jun 2024 11:35:05 -0700 Subject: [PATCH] Use FILE_READ instead of new enum Signed-off-by: Steve Peters --- include/sdf/Error.hh | 3 --- src/SDF.cc | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/sdf/Error.hh b/include/sdf/Error.hh index e6fb4f666..f100ebb58 100644 --- a/include/sdf/Error.hh +++ b/include/sdf/Error.hh @@ -179,9 +179,6 @@ namespace sdf /// \brief Generic error during parsing. PARSING_ERROR, - - /// \brief File not found error. - FILE_NOT_FOUND, }; class SDFORMAT_VISIBLE Error diff --git a/src/SDF.cc b/src/SDF.cc index d2f9febb4..f29bcec61 100644 --- a/src/SDF.cc +++ b/src/SDF.cc @@ -190,7 +190,7 @@ std::string findFile(sdf::Errors &_errors, const std::string &_filename, { if (!_config.FindFileCallback()) { - _errors.push_back({sdf::ErrorCode::FILE_NOT_FOUND, + _errors.push_back({sdf::ErrorCode::FILE_READ, "Tried to use callback in sdf::findFile(), but the callback " "is empty. Did you call sdf::setFindCallback()?"}); return std::string(); @@ -378,7 +378,7 @@ void SDF::Write(sdf::Errors &_errors, const std::string &_filename) if (!out) { - _errors.push_back({sdf::ErrorCode::FILE_NOT_FOUND, + _errors.push_back({sdf::ErrorCode::FILE_READ, "Unable to open file[" + _filename + "] for writing."}); return; } @@ -546,7 +546,7 @@ const std::string &SDF::EmbeddedSpec( } catch(const std::out_of_range &) { - _errors.push_back({sdf::ErrorCode::FILE_NOT_FOUND, + _errors.push_back({sdf::ErrorCode::FILE_READ, "Unable to find SDF filename[" + _filename + "] with " + "version " + SDF::Version()}); }