Track the list of messages that failed to load and write it out in a file at the end