eantyshev commented on code in PR #23999:
URL: https://github.com/apache/beam/pull/23999#discussion_r1033518912
##########
playground/backend/cmd/server/controller.go:
##########
@@ -460,12 +463,15 @@ func (controller *playgroundController) SaveSnippet(ctx
context.Context, req *pb
func (controller *playgroundController) GetSnippet(ctx context.Context, info
*pb.GetSnippetRequest) (*pb.GetSnippetResponse, error) {
if controller.db == nil {
logger.Error("GetSnippet(): the runner is trying to read the
snippet")
- return nil, errors.InvalidArgumentError(errorTitleGetSnippet,
"The runner doesn't support snippets")
+ return nil, cerrors.InvalidArgumentError(errorTitleGetSnippet,
"The runner doesn't support snippets")
}
snippet, err := controller.db.GetSnippet(ctx, info.GetId())
if err != nil {
logger.Errorf("GetSnippet(): error during getting the snippet:
%s", err.Error())
- return nil, errors.InternalError(errorTitleGetSnippet, "Failed
to retrieve the snippet")
+ if errors.Is(err, datastore.ErrNoSuchEntity) {
Review Comment:
that's the primary reason for this PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]