[ox/claw] Improve error clarity when loading ModelObjects
This commit is contained in:
		
							
								
								
									
										5
									
								
								deps/ox/src/ox/claw/read.cpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								deps/ox/src/ox/claw/read.cpp
									
									
									
									
										vendored
									
									
								
							| @@ -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 { | Result<ModelObject> readClaw(TypeStore &ts, const char *buff, std::size_t buffSz) noexcept { | ||||||
| 	oxRequire(header, readClawHeader(buff, buffSz)); | 	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; | 	ModelObject obj; | ||||||
| 	oxReturnError(obj.setType(t)); | 	oxReturnError(obj.setType(t)); | ||||||
| 	switch (header.fmt) { | 	switch (header.fmt) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user