Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
feat: return not found error instead internal error for local file not exist (#3543)
Ryo2c819ace4e60
diff --git a/.gitignore b/.gitignoreindex e19fa0630..c12f0f319 100644--- a/.gitignore+++ b/.gitignore@@ -22,4 +22,7 @@ bin/airdev-dist-dist\ No newline at end of file+dist++# VSCode settings+/.vscodediff --git a/server/router/api/v1/resource_service.go b/server/router/api/v1/resource_service.goindex a49199232..3004cf243 100644--- a/server/router/api/v1/resource_service.go+++ b/server/router/api/v1/resource_service.go@@ -198,6 +198,9 @@ func (s *APIV1Service) GetResourceBinary(ctx context.Context, request *v1pb.GetRfile, err := os.Open(resourcePath)if err != nil {+ if os.IsNotExist(err) {+ return nil, status.Errorf(codes.NotFound, "file not found for resource: %s", request.Name)+ }return nil, status.Errorf(codes.Internal, "failed to open the file: %v", err)}defer file.Close()