You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
430 B
25 lines
430 B
package desc_source |
|
|
|
import ( |
|
"fmt" |
|
"github.com/jhump/protoreflect/grpcreflect" |
|
) |
|
|
|
type notFoundError string |
|
|
|
func notFound(kind, name string) error { |
|
return notFoundError(fmt.Sprintf("%s not found: %s", kind, name)) |
|
} |
|
|
|
func (e notFoundError) Error() string { |
|
return string(e) |
|
} |
|
|
|
func IsNotFoundError(err error) bool { |
|
if grpcreflect.IsElementNotFoundError(err) { |
|
return true |
|
} |
|
|
|
_, ok := err.(notFoundError) |
|
return ok |
|
}
|
|
|