Replace exception by error in log (#6133)

* Replace exception by error in log

* Separate tests for new behaviour

---------

Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
This commit is contained in:
Kim Kulling
2025-05-05 14:07:52 +02:00
committed by GitHub
parent b0e0ce5a28
commit d1b73dffec
3 changed files with 30 additions and 6 deletions

View File

@@ -185,7 +185,7 @@ void SetAccessorRange(Ref<Accessor> acc, void *data, size_t count,
// Allocate and initialize with large values.
for (unsigned int i = 0; i < numCompsOut; i++) {
acc->min.push_back(std::numeric_limits<double>::max());
acc->min.push_back(std::numeric_limits<double>::min());
acc->max.push_back(-std::numeric_limits<double>::max());
}

View File

@@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef ASSIMP_BUILD_NO_GLTF_IMPORTER
#include <assimp/Exceptional.h>
#include <assimp/DefaultLogger.hpp>
#include <algorithm>
#include <list>
@@ -444,7 +445,7 @@ inline Value *FindArrayInContext(Value &val, const char *memberId, const char *c
return &it->value;
}
inline Value *FindObjectInContext(Value &val, const char *memberId, const char *context, const char *extraContext = nullptr) {
inline Value *FindObjectInContext(Value &val, const char * memberId, const char *context, const char *extraContext = nullptr) {
if (!val.IsObject()) {
return nullptr;
}
@@ -453,8 +454,9 @@ inline Value *FindObjectInContext(Value &val, const char *memberId, const char *
return nullptr;
}
if (!it->value.IsObject()) {
throwUnexpectedTypeError("object", memberId, context, extraContext);
}
ASSIMP_LOG_ERROR("Member \"", memberId, "\" was not of type \"", context, "\" when reading ", extraContext);
return nullptr;
}
return &it->value;
}