Errors might happen in classes and not in files

This is a fix to correctly display the source of an error found in the log file.