package sms

import "context"

type UnavailableProvider struct {
	err error
}

func NewUnavailableProvider(err error) *UnavailableProvider {
	return &UnavailableProvider{err: err}
}

func (p *UnavailableProvider) SendLoginCode(ctx context.Context, phone string, code string) error {
	if err := ctx.Err(); err != nil {
		return err
	}
	if p.err != nil {
		return p.err
	}
	return ErrProviderConfigInvalid
}
