Check file extension and error message