23 ms·
Sure, a library has to handle errors differently than an application using that library. The library should "back off" by aborting anything it is doing and ind
by pferde 6y ago
Sure, a library has to handle errors differently than an application using that library.
The library should "back off" by aborting anything it is doing and indicating failure without crashing or exiting the process (a return value indicating an error, setting the "errno" variable, making an error pointer provided by the caller point to an error object/struct, ...). Of course, the other side of the coin is that caller (the application or another library) has to actually check for that error indication, and determine what to do about it.