- Introduce a new function to create the no data found error - Simplify error checking logic for clarity and consistency