There are certain widely accepted norms on how to handle errors in C. It is best to restrain ourselves to "prior art" so that your code is immediately comfortable to read and use for a seasoned C dev.
To list a few: return codes, errno and longjump
A seasoned dev that thinks errno and longjump are good idea's should have retired 25 years ago.