generated from VLADIMIR/template
21 lines
565 B
Go
21 lines
565 B
Go
package app
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"evening_detective_server/internal/services/gameplay_service"
|
|
|
|
"google.golang.org/grpc/codes"
|
|
"google.golang.org/grpc/status"
|
|
)
|
|
|
|
func gameplayErrorStatus(err error, internalMessage string) error {
|
|
if errors.Is(err, gameplay_service.ErrTeamNotFound) {
|
|
return status.Error(codes.NotFound, gameplay_service.ErrTeamNotFound.Error())
|
|
}
|
|
if errors.Is(err, gameplay_service.ErrGameNotFound) {
|
|
return status.Error(codes.NotFound, gameplay_service.ErrGameNotFound.Error())
|
|
}
|
|
return status.Error(codes.Internal, internalMessage)
|
|
}
|