I've encountered an issue with a TypeScript function that is flagging inconsistent return error. The function includes a try block that returns a value and a catch block that throws an error, resulting in the inconsistency. I am struggling to find a workaround for this situation.
async function someFunction(): Promise<Course> {
try {
// Implementing code logic to generate a Course object
return courseObject;
} catch (error) {
throw new ApolloError(....);
}
}