add deprecated_warn_for/error_for methods.