From b312afd192a92eeaa3426fdf42ea8098e291de1c Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Wed, 13 Sep 2023 10:48:04 +0200 Subject: [PATCH] Fix exception checks in cafObject.cpp * nlohmann json exceptions do not inherit runtime_error --- Core/cafObject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/cafObject.cpp b/Core/cafObject.cpp index 3a51b64c..dea7160a 100644 --- a/Core/cafObject.cpp +++ b/Core/cafObject.cpp @@ -79,7 +79,7 @@ bool Object::readFromJsonFile( const std::string& filePath ) ObjectPerformer<> performer( []( ObjectHandle* object ) { object->initAfterRead(); } ); performer.visitObject( this ); } - catch ( std::runtime_error& err ) + catch ( const std::exception& err ) { CAFFA_ERROR( err.what() ); return false; @@ -108,7 +108,7 @@ bool Object::writeToJsonFile( const std::string& filePath ) const serializer.setSerializeUuids( false ); serializer.writeStream( this, outStream ); } - catch ( std::runtime_error& err ) + catch ( const std::exception& err ) { CAFFA_ERROR( err.what() ); return false;