Oxsomi / core3

Oxsomi Core3 is a combination of standalone C libraries useful for building applications, such as types, platform, graphics abstraction and file formats
GNU General Public License v3.0
0 stars 1 forks source link

Replace gotoIfError with new error handling #147

Open Nielsbishere opened 6 months ago

Nielsbishere commented 6 months ago

Error* to make it optional and return Bool. This should be refactored through the entire codebase to reduce the amount of random Error structs being generated.

Nielsbishere commented 2 months ago

_ERROR_LEVEL at compile-time to decide what needs error checking. For example: ERROR_LEVEL_FATAL might be for things that cause fatal issues (memory corruption, etc.) ERROR_LEVEL_ERROR for things that are one level below fatal but still very important ERROR_LEVEL_UNDEFINED_BEHAVIOR things that could cause undefined behavior on certain systems ERROR_LEVEL_WARN for things that might cause issues ERROR_LEVEL_PERFORMANCE for things that might have a negative performance impact

At runtime in production, likely ERROR_LEVEL_ERROR should be used, to prevent unnecessary time spent on sanity checks.