Files
descrybe/apps/api/internal/woocommerce/errors.go
T
greeneclipse 8580c996c3 Initial commit of Descrybe v2 without local scratch artifacts.
Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
2026-08-09 22:47:43 +02:00

22 lines
558 B
Go

package woocommerce
import "errors"
// ClientError reports whether err is a known client-facing WooCommerce config/sync error.
func ClientError(err error) (msg string, ok bool) {
switch {
case err == nil:
return "", false
case errors.Is(err, ErrInvalidStoreURL),
errors.Is(err, ErrBlockedStoreURL),
errors.Is(err, ErrNotConfigured),
errors.Is(err, ErrNotEnabled),
errors.Is(err, ErrMissingCreds),
errors.Is(err, ErrInvalidSyncScope),
errors.Is(err, ErrInvalidScheduleInterval):
return err.Error(), true
default:
return "", false
}
}