// Code generated by protoc-gen-go-errors. DO NOT EDIT.

package v1

import (
	fmt "fmt"
	errors "github.com/go-kratos/kratos/v2/errors"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the kratos package it is being compiled against.
const _ = errors.SupportPackageIsVersion1

func IsCasBackendErrorReasonUnspecified(err error) bool {
	if err == nil {
		return false
	}
	e := errors.FromError(err)
	return e.Reason == CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_UNSPECIFIED.String() && e.Code == 500
}

func ErrorCasBackendErrorReasonUnspecified(format string, args ...interface{}) *errors.Error {
	return errors.New(500, CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_UNSPECIFIED.String(), fmt.Sprintf(format, args...))
}

func IsCasBackendErrorReasonRequired(err error) bool {
	if err == nil {
		return false
	}
	e := errors.FromError(err)
	return e.Reason == CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_REQUIRED.String() && e.Code == 403
}

func ErrorCasBackendErrorReasonRequired(format string, args ...interface{}) *errors.Error {
	return errors.New(403, CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_REQUIRED.String(), fmt.Sprintf(format, args...))
}

// The repository does not seem to be operational
// a previous validation has failed
func IsCasBackendErrorReasonInvalid(err error) bool {
	if err == nil {
		return false
	}
	e := errors.FromError(err)
	return e.Reason == CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_INVALID.String() && e.Code == 403
}

// The repository does not seem to be operational
// a previous validation has failed
func ErrorCasBackendErrorReasonInvalid(format string, args ...interface{}) *errors.Error {
	return errors.New(403, CASBackendErrorReason_CAS_BACKEND_ERROR_REASON_INVALID.String(), fmt.Sprintf(format, args...))
}
