Skip to content

lib: new error implementation

This implements a function based error system. Instead of passing in the error code as first argument, the error code itself is a error class. It already contains the correct error type, so while adding a new error no one has to think about the error type anymore. In case a single error code has more than one error type, the error class has properties for the non default error types. Those can be used as fallback.

This prevents typos, makes the implementation easier and it is less verbose when writing the code for a new error.

The implementation itself does not interfere with the old implementation. So the old and the new system can co-exist and it is possible to slowly migrate the old ones to the new system.

By doing this I also realized that there are multiple error codes that are currently not used at all. I also found other mistakes where a wrong error type was in place.

So far this is only WIP and I wanted to get some feedback.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

lib

Merge request reports

Loading