Closed ConnorY97 closed 3 months ago
Ive decided that I dont want it to return a result, I think we should make it crash nicely and log it better instead For this specific case you could just check the string if its empty and then fail the test, Then check your logs as to why Returning a result to something like this just adds so much boiler plate for every function call that will be identical in every call I just dont like the idea of being like, "I want this shader file, Sweet now let me wrap all of this call in a if check, and add different outputs for each result case" where you could do all of this from inside the manager it self
Implement SLIME_RESULT Error Handling System
Objective
Implement a consistent error handling system using
SLIME_RESULT
throughout the engine to improve error reporting, debugging, and overall code robustness.Description
We need to replace the current error handling system with a new
SLIME_RESULT
enum-based approach. This will provide more detailed error information and allow for consistent error handling across the entire codebase.Tasks
Update
slime_common.h
:SLIME_RESULT
enum with appropriate error codes.#pragma once
to prevent redefinition errors.Create
SlimeErrorUtils.h
:errcheck
function template for standardized error checking and logging.inline
to prevent multiple definition errors.Update existing functions:
SLIME_RESULT
instead ofbool
/void
where appropriate.nullptr
) withSLIME_RESULT
.SLIME_RESULT
system.Update
ModelManager
:LoadModel
to returnSLIME_RESULT
and use an out parameter for the model resource.Update Resource Loading Functions:
LoadBunny
,LoadMonkey
,LoadCube
, and similar functions to useSLIME_RESULT
anderrcheck
.Error Logging:
spdlog
is properly integrated for error logging.Documentation:
SLIME_RESULT
anderrcheck
in the codebase.Testing:
SLIME_RESULT
.Code Review:
Acceptance Criteria
SLIME_RESULT
.errcheck
is used consistently for error checking and logging.SLIME_RESULT
orerrcheck
.Additional Notes
Related Issues
#XXX
: Previous error handling improvement discussion#YYY
:spdlog
integrationPlease update this issue with any additional tasks or considerations as the implementation progresses.