Separate error messages into a JSON file