Skip to content

Commit

Permalink
Improve deserialization error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
SirLynix authored Dec 18, 2024
1 parent 6f6acf5 commit 155ee76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/NZSL/Archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ namespace nzsl
std::uint32_t version;
deserializer.Deserialize(version);
if (version > s_shaderArchiveCurrentVersion)
throw std::runtime_error("unsupported version");
throw std::runtime_error(fmt::format("unsupported archive version {0} (max supported version: {1})", version, s_shaderArchiveCurrentVersion));

std::uint32_t moduleCount;
deserializer.Deserialize(moduleCount);
Expand Down
2 changes: 1 addition & 1 deletion src/NZSL/Ast/AstSerializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ namespace nzsl::Ast

m_deserializer.Deserialize(m_version);
if (m_version > s_shaderAstCurrentVersion)
throw std::runtime_error("unsupported version");
throw std::runtime_error(fmt::format("unsupported module version {0} (max supported version: {1})", m_version, s_shaderAstCurrentVersion)));

ModulePtr module = std::make_shared<Module>();
SerializeModule(*module);
Expand Down

0 comments on commit 155ee76

Please # to comment.