API Return code for not finding any data

Is there a way of getting a return code from the any of the chatgpt models / through an API call, that indicates the engine couldn’t find any data? Totally get that it returns “As of our October 2023 model we don’t have…”, but as these messages change it’s hard to write code that it couldn’t find anything. Maybe this is already solved… just putting the question out there.