Throw an exception on invalid source files.