docs for error handling