Refactors the updateUploadStatusTable to throw the exception to the upload operation (where the upload failed)
The recover on attemptToProcessIngestedFile has a separate case block for UnsupportedMimeType exceptions so that:
the failure to process the file for this reason will be logged as info rather than an error
increments a metric with the uploader and and mimetype
## How should a reviewer test this change?
Upload a non-image file and check the logs for a "File has unsupported mime type" entry.
## How can success be measured?
Less errors in the logs. Able to see which unsupported file types are often uploaded and by whom
## Who should look at this?
Tested? Documented?
[x] locally by committer
[ ] locally by Guardian reviewer
[ ] on the Guardian's TEST environment
[ ] relevant documentation added or amended (if needed)
All deployment options
- [Deploy build 12259 to TEST](https://riffraff.gutools.co.uk/deployment/deployAgain?project=media-service%3A%3Agrid%3A%3Aall&build=12259&stage=TEST&updateStrategy=MostlyHarmless&action=deploy)
- [Deploy parts of build 12259 to TEST by previewing it first](https://riffraff.gutools.co.uk/preview/yaml?project=media-service%3A%3Agrid%3A%3Aall&build=12259&stage=TEST&updateStrategy=MostlyHarmless)
What does this change?
Refactors the
updateUploadStatusTable
to throw the exception to the upload operation (where the upload failed)The
recover
onattemptToProcessIngestedFile
has a separate case block forUnsupportedMimeType
exceptions so that:Tested? Documented?