From e4ed8f7a055345bdfb82de707eaedae058f462c5 Mon Sep 17 00:00:00 2001 From: MelchiorSchuh Date: Fri, 28 Aug 2026 11:41:01 +0200 Subject: [PATCH 1/2] fix(Unzip): Fixed thrown exception if file doesn't exist --- src/geode/basic/zip_file.cpp | 6 ++++++ src/geode/mesh/core/grid.cpp | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/geode/basic/zip_file.cpp b/src/geode/basic/zip_file.cpp index 9633e7477..a4a0b43a1 100644 --- a/src/geode/basic/zip_file.cpp +++ b/src/geode/basic/zip_file.cpp @@ -142,6 +142,12 @@ namespace geode public: Impl( std::string_view file, std::string_view unarchive_temp_filename ) { + if( !std::filesystem::exists( file ) ) + { + throw OpenGeodeBasicException( nullptr, + OpenGeodeException::TYPE::internal, + "[UnzipFile] File to unzip doesn't exist" ); + } directory_ = create_directory( file, unarchive_temp_filename ); if( !load_zip_into_memory( file ) || !open_reader() ) { diff --git a/src/geode/mesh/core/grid.cpp b/src/geode/mesh/core/grid.cpp index 4ac885ee3..a58ba952a 100644 --- a/src/geode/mesh/core/grid.cpp +++ b/src/geode/mesh/core/grid.cpp @@ -185,8 +185,11 @@ namespace geode OpenGeodeMeshException::check_exception( diff == 0 || diff == 1, nullptr, OpenGeodeException::TYPE::data, "[Grid::cell_local_vertex] vertex [", vertex_id[0], ",", - vertex_id[1], "] is not part of cell [", cell_id[0], ",", - cell_id[1], "] vertices." ); + vertex_id[1], + dimension == 3 ? absl::StrCat( ",", vertex_id[2] ) : "", + "] is not part of cell [", cell_id[0], ",", cell_id[1], + dimension == 3 ? absl::StrCat( ",", cell_id[2] ) : "", + "] vertices." ); result += diff * ( 1 << d ); } return result; From 35c66f1ed4c46b9371a2076e2ce36deb677a4398 Mon Sep 17 00:00:00 2001 From: MelchiorSchuh Date: Fri, 28 Aug 2026 11:43:42 +0200 Subject: [PATCH 2/2] fix exception type --- src/geode/basic/zip_file.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geode/basic/zip_file.cpp b/src/geode/basic/zip_file.cpp index a4a0b43a1..19a4966ef 100644 --- a/src/geode/basic/zip_file.cpp +++ b/src/geode/basic/zip_file.cpp @@ -145,7 +145,7 @@ namespace geode if( !std::filesystem::exists( file ) ) { throw OpenGeodeBasicException( nullptr, - OpenGeodeException::TYPE::internal, + OpenGeodeException::TYPE::data, "[UnzipFile] File to unzip doesn't exist" ); } directory_ = create_directory( file, unarchive_temp_filename );