func IsErrorAccountDisabled(err error) bool {
	switch err := err.(type) {
	case *HTTPError:
		model := AccountDisabled().(*HTTPError)
		return model.HTTPStatus == err.HTTPStatus && model.PublicReason == err.PublicReason
	}
	return false
}
IsErrorAccountDisabled checks if the provided error is the same as an "Account Disabled" error.
See AccountDisabled() in this package.
package backend
import (
	"errors"
	"fmt"
	"net/http"
)
type HTTPError struct {
	HTTPStatus   int
	PublicReason string
	WrappedError error
}
func (e *HTTPError) Error() string {
	return e.WrappedError.Error()
}
func (e *HTTPError) Rewrap(msg string) {
	e.WrappedError = fmt.Errorf("%v : %w", msg, e.WrappedError)
}
func WrapError(msg string, err error) error {
	switch err := err.(type) {
	case *HTTPError:
		err.Rewrap(msg)
		return err
	case error:
		return fmt.Errorf("%v : %w", msg, err)
	}
	return fmt.Errorf(msg)
}
func HTTPErr(statusCode int, reason string, wrappedError error) error {
	return &HTTPError{
		HTTPStatus:   statusCode,
		PublicReason: reason,
		WrappedError: wrappedError,
	}
}
func BadInputErr(err error, reason string) error {
	return HTTPErr(http.StatusBadRequest, reason, err)
}
func DatabaseErr(err error) error {
	return HTTPErr(http.StatusInternalServerError, "Internal service error", err)
}
func UploadErr(err error) error {
	return HTTPErr(http.StatusInternalServerError, "The upload action could not be completed. Please try again.", err)
}
func DeleteErr(err error) error {
	return HTTPErr(http.StatusInternalServerError, "The delete action could not be completed. Please try again.", err)
}
func NotFoundErr(err error) error { return HTTPErr(http.StatusNotFound, "Not Found", err) }
func UnauthorizedReadErr(err error) error {
	return HTTPErr(http.StatusNotFound, "Not Found", err)
}
func UnauthorizedWriteErr(err error) error {
	return HTTPErr(http.StatusUnauthorized, "Unauthorized", err)
}
func CSRFErr(err error) error { return HTTPErr(http.StatusForbidden, "CSRF Failure", err) }
func BadAuthErr(err error) error { return HTTPErr(http.StatusForbidden, "Forbidden", err) }
func UserRequiresAdditionalAuthenticationErr(reason string) error {
	return HTTPErr(http.StatusPreconditionFailed, reason, fmt.Errorf("User requires additional auth: %s", reason))
}
func InvalidPasswordErr(err error) error {
	return HTTPErr(http.StatusUnauthorized, "Invalid password", err)
}
func InvalidCredentialsErr(err error) error {
	return HTTPErr(http.StatusUnauthorized, "Invalid username or password", err)
}
func InvalidRecoveryErr(err error) error {
	return HTTPErr(http.StatusUnauthorized, "Recovery code is invalid. Please ask an administrator to generate a new code.", err)
}
func MissingValueErr(valueName string) error {
	reason := fmt.Sprintf("Missing required field: %s", valueName)
	return HTTPErr(http.StatusBadRequest, reason, errors.New(reason))
}
func AccountDisabled() error {
	err := DisabledUserError()
	return HTTPErr(http.StatusForbidden, err.Error(), err)
}