Add docs for error handling