Code review feedback - proper handling of error cases