<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save_model(model: AbstractModel, name_suffix: str, on_failure: str) -> None: """ Save the given model with the given name_suffix. On failure, take the specified action. :param model: the model to be saved :param name_suffix: name to be used for saving :param on_failure: action to be taken on failure; one of :py:attr:`SAVE_FAILURE_ACTIONS` :raise IOError: on save failure with ``on_failure`` set to ``error`` """

        try:
            logging.debug('Saving the model')
            save_path = model.save(name_suffix)
            logging.info('Model saved to: %s', save_path)
        except Exception as ex:  # pylint: disable=broad-except
            if on_failure == 'error':
                raise IOError('Failed to save the model.') from ex
            elif on_failure == 'warn':
                logging.warning('Failed to save the model.')