Closed elfring closed 10 years ago
I'm not particularly interested in error-handling fprintf, since it will just make the code much noisier for no particular practical benefit. sigaction would be reasonable.
I would appreciate if the specified output was successfully written to a file. How do you think about to detect every error situation as early as possible?
I don't know what I would do if the fprintf
fails, here -- if we can't write to stderr, how are we going to report the error to the user? It should also be a super rare condition for writing to stderr to error out.
A failure (e. g. full log file) could be indicated by the return value of your program, couldn't it?
Are you interested to apply aspect-oriented software development? How do you think about to encapsulate error detection and corresponding exception handling as a reusable aspect in your software?
Would you like to add more error handling for return values from functions like the following?