Accidentally deleted documentation of error handling function. Documentation is re-added here.