Added ObjectPropertyException and SystemException as possible exceptions of the getTaskById method. Introduced a conditional statement to check if the task exists before attempting to access its data, preventing exceptions related to non-existent tasks.