So, you're having this function return two values: a success boolean, and the requested list of courses. Rather than using a success boolean, you should let the function raise an exception if the function call fails, and rely on the caller catching the exception if the caller intends to handle a failure case. This will also simplify your logic a bit: there's no need to catch the `ItemNotFoundError`, or to worry about other exceptions lurking in this code -- if they raise, that indicates the function call failed, so an exception *should* be raised.