I'm familiar with
\PackageError as a way to cause LaTeX to report a custom error message when the command is run. But I'm wondering, is there a way to cause LaTeX to report an error, with a custom filename and location?
I run my .tex files through an external preprocessor, and when that preprocessor fails, I'd like to have my editor (vscode Latex-workshop) report the error inline. My thinking is that, if the preprocessor fails, I can have it generate a "dummy" file that calls
PackageError reporting the location of the preprocessing error.
I also use latexmk, so if there's a way to do this using its tools, that would work too.