I'm writing program in C and I have function handleError(int errcode)
available.
All it does is unallocate all memory space and call exit(errcode)
.
In program I have 2 options.
Have all functions return error code to caller. Do the full chain of handling returned error codes to
main
and handle it here.Have most of functions returning
void
and callhandleError
whenever the error occurs and program has to be stoped.
What is more readable, manageable, and performance-wise choice?
Our team is not united in this matter and I need some outside view on this.
EDIT:
I am gonna add few informations. Errors will be rare and none of errors detected that way will be recoverable.