Fix exception to use the filename instead of a blank string.

The exception was not reporting the problem file due to using the wrong
variable.