[ox/claw] Improve error clarity when loading ModelObjects

This commit is contained in:
Gary Talent 2023-12-30 13:57:51 -06:00
parent 89fab5cc20
commit bd2aeee276

View File

@ -74,7 +74,10 @@ Result<Buffer> stripClawHeader(const ox::Buffer &buff) noexcept {
Result<ModelObject> readClaw(TypeStore &ts, const char *buff, std::size_t buffSz) noexcept {
oxRequire(header, readClawHeader(buff, buffSz));
oxRequire(t, ts.getLoad(header.typeName, header.typeVersion, header.typeParams));
auto const [t, tdErr] = ts.getLoad(header.typeName, header.typeVersion, header.typeParams);
if (tdErr) {
return OxError(3, "Could not load type descriptor");
}
ModelObject obj;
oxReturnError(obj.setType(t));
switch (header.fmt) {