Generalize catch clause for version compatibility