Fix error reporting issue of non-extension file