Way to determine which file had a YAML exception?

Is there a way to determine which file had a YAML error?

The solution here:

https://forum.middlemanapp.com/t/which-source-file-is-causing-an-error/1670

is specific to middleman-blog, so doesn’t help me.

Problem is I have a project with 100’s of pages of .erb files, each with a bit of YAML front matter. A client has edited, and now I have to find where he’s broken it…

Maybe it is better in 4.x? I am currently using 3.0.11, I wanted to kill these errors before updating Middleman. However, there are just a few (5) so will only affect those files. So will go ahead and update Middleman and deal with the other issues around the version upgrade.

I’m surprised no one has responded to this.

There is a classic solution to this class of problems, and it’s slick. I’ve used it many times, when I have no other alternative. It is to use a binary search algorithm. If you don’t know what that is, here are a couple of useful references:

Tom