Use the ThrowingConsumer in IO when writing to JSON.