mik
mik copied to clipboard
Improve error reporting by flagging missing required settings
Today I was working on a metadata-only CSV, and having some annoying issues that were difficult to debug. The problem, it turns out, was that several parameters in the [FILE_GETTER] section are required, but I didn't realize it.
I was getting the following error:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 130968 bytes) in /Users/Brandon/mik/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php on line 82
Turns out I needed to add the following lines:
[FILE_GETTER]
class = "CsvSingleFile"
input_directory =
validate_input = FALSE
file_name_field = "filename"
AND add a "filename" column to my CSV even though there are no files.
That was an iterative process. It would be nice if the error reported something like "[FILE_GETTER] section is required", "FILE_GETTER class is required", "FILE_GETTER input_directory is required", "FILE_GETTER file_name_field is required", etc.