Move the error saving logic to bot model.