Claude/add error handling u zgsj#501
Merged
Merged
Conversation
Converted silent early-returns into actionable WARN/ERROR log entries in several hot-path loaders so runtime bugs surface instead of being swallowed: - EntityArchetypeLoader: log when GetComponentRaw returns null, when TypeInfo lookup misses, when archetype property names don't match any reflected field, and include the registered archetype count in the 'archetype not found' warning. - SaveSystem::ReadFromFile: log the path + errno on open failure, on negative tellg(), on a truncated file (<8 bytes), and on invalid or truncated magic header. Deserialize lambda now logs when GetComponentRaw returns null instead of silently skipping property restore. - SceneManager::SavePrefab/LoadPrefab: log out-of-range nodeIndex and include path + errno on open failure (previously silent false/-1). - SoundEffect::LoadFromFile: include the filename (and errno) in the open-failure log, and log bytes-expected vs bytes-read on a short read (previously silent E_FAIL). All additions use the existing SPARK_LOG_* macros; no new infrastructure. Builds clean under linux-gcc-release.
Converted additional silent early-returns and swallowed parse errors into SPARK_LOG_* calls so runtime failures surface in logs instead of being hidden: - AI/NavMesh: log path+errno on open failure; log bad magic / unsupported version when parsing .snav files. - Modding/ModSystem: log path+errno on manifest open failure and log when the JSON root is not an object. - Replay/ReplaySystem: log path+errno on open failures (Save/Load); log invalid magic with expected vs got bytes. - Animation/AnimationSystem: log path+errno on LoadAnimations open failure; log bad magic with printable bytes when .sanim header is wrong. - Graphics/ModelLoading: BindMesh/BindMaterial now emit SPARK_LOG_ONCE warnings for missing/not-loaded assets, wrong-type assets, and missing GPU buffers (rate-limited so a persistently missing mesh doesn't spam the log). - Audio/OpenALAudioEngine: replaced fprintf(stderr, ...) with SPARK_LOG_ERROR across WAV load paths (open failure, empty file, oversized file, truncated RIFF header) so messages go through the unified logger / sinks. - Core/ModuleManager: add SPARK_LOG_ERROR with errno alongside the existing SimpleConsole warning on manifest open failure. - Core/ComponentReflection: SetFieldFromString now logs the offending input when Float/Double std::stof/stod throws and when Vector2/3/4 parsing fails (previously returned false silently). - SaveSystem/WriteToFile: log temp-file open failure with path+errno. No new infrastructure — all additions use existing SPARK_LOG_* / SPARK_LOG_ONCE macros. SparkEngineLib builds clean under linux-gcc-release; clang-format passes.
Continued replacing silent early-returns / swallowed parse errors with SPARK_LOG_* calls that include context (file path, errno, actual vs expected values). No new infrastructure — all additions use existing macros. Builds clean under linux-gcc-release; clang-format passes. - Graphics/TextureCompressor: SaveCompressed logs ERROR on open/write failure with path+errno; LoadCompressed logs on open failure, bad magic (prints actual vs expected bytes), truncated header, truncated mip size table, and truncated mip data. Previously returned empty CompressedTexture silently, making missing textures invisible. - Graphics/ShaderDiskCache: Lookup logs ONCE/Warn when a cache file existed at the existence check but failed to open (race / permission), and on short reads (file truncated mid-load). Store logs ONCE/Warn on ofstream open failure and on post-write stream errors — silent write failures previously caused the cache to appear populated but hold corrupt/zero-length blobs forever. - Graphics/RenderGraph/RenderGraphExporter: ExportGraphViz logs ERROR when the file stream goes bad after write (disk full / I/O) instead of returning the raw bool. - Engine/Streaming/DirectStorageLoader: FallbackAsyncLoad logs WARN on bad offsets (past end of file) and out-of-bounds read-size math — these represent caller/manifest programming errors that previously failed silently. - Engine/Streaming/SceneManifest: ParseFromFile logs WARN on open failure with path+errno and when a manifest parsed zero assets (likely bad key=value format). - Engine/Localization/LocalizationSystem: StringTable::LoadFromFile logs WARN when the regex matched zero entries (bad JSON format). SetCurrentLanguage logs WARN when the requested language isn't loaded, with the count of available languages. - Engine/Dialogue/DialogueSystem: DialogueTree::LoadFromFile logs WARN on skipped nodes (missing nodeId) and ERROR when the tree parsed zero valid nodes. DialogueSystem::StartConversation logs WARN on unknown tree id with the number of registered trees. - Engine/Security/MemoryIntegrity: RegisterCodeRegions logs WARN on Linux when /proc/self/maps cannot be opened — previously code-page integrity scanning silently disabled itself.
Contributor
Code Coverage (GCC + lcov)Per-Subsystem Coverage
Total: 50.9% (28307/55647 lines) |
Contributor
❌ CI Error ReportFailed jobs: clang-tidy, macos-Debug-OpenGL, macos-Release-Metal, macos-Release-OpenGL, windows-vs2022-Release Build ErrorsOther errors (1)Test Failures
|
| Test | Jobs |
|---|---|
| [02:07:59.343] [TID:6672] [WARN ] [Network ] RCON unknown command: nonexistent_cmd (DedicatedServer.cpp:573) | windows-vs2022-Release |
| [02:07:59.357] [TID:6672] [WARN ] [Network ] NetBuffer::ReadUint8 — buffer overrun at pos 1 (size=1) (NetworkBuffer.c... | windows-vs2022-Release |
| [02:07:59.378] [TID:6672] [WARN ] [AI ] BuildNavMeshWithRecast: empty geometry (RecastDetourBackend.cpp:35) | windows-vs2022-Release |
| [02:07:59.378] [TID:6672] [WARN ] [AI ] NavMeshBuilder: Recast build failed, falling back to triangle-soup builder (N... | windows-vs2022-Release |
| [02:07:59.378] [TID:6672] [WARN ] [Audio ] XAudio2 backend requested but no AudioEngine provided, falling back to Nul... | windows-vs2022-Release |
| [ OK ] FixedTi[02:07:59.395] [TID:6672] [WARN ] [Graphics ] No graphics backend available — falling back to NullRHIDe... | windows-vs2022-Release |
| [02:07:59.396] [TID:6672] [WARN ] [Graphics ] No graphics backend available — falling back to NullRHIDevice (headless... | windows-vs2022-Release |
| [02:07:59.400] [TID:6672] [WARN ] [Editor ] Cannot host: userName is empty. (CollaborativeEditSession.cpp:454) | windows-vs2022-Release |
| [02:07:59.400] [TID:6672] [WARN ] [Editor ] Already connected. (CollaborativeEditSession.cpp:459) | windows-vs2022-Release |
| [02:07:59.403] [TID:6672] [WARN ] [Editor ] BroadcastEdit rejected: nodeId is empty. (CollaborativeEditSession.cpp:1108) | windows-vs2022-Release |
| [02:07:59.403] [TID:6672] [WARN ] [Editor ] BroadcastEdit rejected: sourceEditor is not set. (CollaborativeEditSessio... | windows-vs2022-Release |
| [02:07:59.404] [TID:6672] [WARN ] [Editor ] SetLocalSelection rejected: nodeId exceeds 255 chars (length=300). (Colla... | windows-vs2022-Release |
| [02:08:04.983] [TID:6672] [WARN ] [Network ] Connection rejected for pending client 5: server full (4/4) (NetworkConn... | windows-vs2022-Release |
| [02:08:04.984] [TID:6672] [WARN ] [Network ] Connection rejected for pending client 5: server full (4/4) (NetworkConn... | windows-vs2022-Release |
| [02:08:04.985] [TID:6672] [WARN ] [Network ] Invalid packet magic 0x6A0E5CB3 (expected 0x5350524B) (NetworkManager.cp... | windows-vs2022-Release |
Updated: 2026-04-19T02:09:52Z — this comment is updated in-place, not duplicated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.