github.com/asynkron/protoactor-go@v0.0.0-20240308120642-ef91a6abee75/protobuf/protoc-gen-go-grain/test/error/error_grain.pb.go (about) 1 // Code generated by protoc-gen-grain. DO NOT EDIT. 2 // versions: 3 // protoc-gen-grain v0.6.0 4 // protoc v4.25.0 5 // source: test/error/error.proto 6 7 package hello 8 9 import ( 10 fmt "fmt" 11 cluster "github.com/asynkron/protoactor-go/cluster" 12 ) 13 14 func ErrUserNotFound(format string, args ...interface{}) *cluster.GrainErrorResponse { 15 return cluster.NewGrainErrorResponse(ErrorReason_USER_NOT_FOUND.String(), fmt.Sprintf(format, args...)) 16 } 17 18 func IsUserNotFound(err error) bool { 19 if err == nil { 20 return false 21 } 22 e := cluster.FromError(err) 23 return e.Reason == ErrorReason_USER_NOT_FOUND.String() 24 } 25 26 func ErrContentMissing(format string, args ...interface{}) *cluster.GrainErrorResponse { 27 return cluster.NewGrainErrorResponse(ErrorReason_CONTENT_MISSING.String(), fmt.Sprintf(format, args...)) 28 } 29 30 func IsContentMissing(err error) bool { 31 if err == nil { 32 return false 33 } 34 e := cluster.FromError(err) 35 return e.Reason == ErrorReason_CONTENT_MISSING.String() 36 }