document error handling