In this example doSomething() function return true if succesful or false if fail
In case of failure, all functions (which fails) will call a unique function (error_Handler()) wich take the error code as argument.
This error_handler() function will take care about all actions in case of failure , based on a error code (given as argument) such us: displayng details about the error, cleanning resources etc.
This is only the simplest example, you can expand this ideea to do more complex job.
I think you have misunderstood his question. He is asking for error correction codes, aka channel coding. I don't think any tutorial on channel coding can be "simple", especially when you are asking a question that spans an entire field. It would be good if you can focus on what kind of codes you are targeting, eg RS, BCH, Turbo etc. It's best to take up a book.
Try out Any introdcutory text for communication techniques which deals with data integrity.
Analog and Digital communication by B.P. Lathi is quite good.
try out : www.eccpage.com also you might get something.