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
chore: tweak error message
Stevenff81ea602d6b
diff --git a/bin/memos/main.go b/bin/memos/main.goindex e8181bced..c28d1aeed 100644--- a/bin/memos/main.go+++ b/bin/memos/main.go@@ -14,7 +14,7 @@ import ("github.com/usememos/memos/internal/jobs""github.com/usememos/memos/server"- _profile "github.com/usememos/memos/server/profile"+ "github.com/usememos/memos/server/profile""github.com/usememos/memos/store""github.com/usememos/memos/store/db")@@ -31,22 +31,22 @@ const ()var (- profile *_profile.Profile- mode string- addr string- port int- data string- driver string- dsn string- serveFrontend bool- allowedOrigins []string+ mode string+ addr string+ port int+ data string+ driver string+ dsn string+ serveFrontend bool+ allowedOrigins []string+ instanceProfile *profile.ProfilerootCmd = &cobra.Command{Use: "memos",Short: `An open source, lightweight note-taking service. Easily capture and share your great thoughts.`,Run: func(_cmd *cobra.Command, _args []string) {ctx, cancel := context.WithCancel(context.Background())- dbDriver, err := db.NewDBDriver(profile)+ dbDriver, err := db.NewDBDriver(instanceProfile)if err != nil {cancel()slog.Error("failed to create db driver", err)@@ -58,14 +58,14 @@ var (return}- storeInstance := store.New(dbDriver, profile)+ storeInstance := store.New(dbDriver, instanceProfile)if err := storeInstance.MigrateManually(ctx); err != nil {cancel()slog.Error("failed to migrate manually", err)return}- s, err := server.NewServer(ctx, profile, storeInstance)+ s, err := server.NewServer(ctx, instanceProfile, storeInstance)if err != nil {cancel()slog.Error("failed to create server", err)@@ -162,7 +162,7 @@ func init() {func initConfig() {viper.AutomaticEnv()var err error- profile, err = _profile.GetProfile()+ instanceProfile, err = profile.GetProfile()if err != nil {fmt.Printf("failed to get profile, error: %+v\n", err)return@@ -179,15 +179,15 @@ mode: %sdriver: %sfrontend: %t----`, profile.Version, profile.Data, profile.DSN, profile.Addr, profile.Port, profile.Mode, profile.Driver, profile.Frontend)+`, instanceProfile.Version, instanceProfile.Data, instanceProfile.DSN, instanceProfile.Addr, instanceProfile.Port, instanceProfile.Mode, instanceProfile.Driver, instanceProfile.Frontend)}func printGreetings() {print(greetingBanner)- if len(profile.Addr) == 0 {- fmt.Printf("Version %s has been started on port %d\n", profile.Version, profile.Port)+ if len(instanceProfile.Addr) == 0 {+ fmt.Printf("Version %s has been started on port %d\n", instanceProfile.Version, instanceProfile.Port)} else {- fmt.Printf("Version %s has been started on address '%s' and port %d\n", profile.Version, profile.Addr, profile.Port)+ fmt.Printf("Version %s has been started on address '%s' and port %d\n", instanceProfile.Version, instanceProfile.Addr, instanceProfile.Port)}fmt.Printf(`---See more in:diff --git a/server/route/api/v2/auth_service.go b/server/route/api/v2/auth_service.goindex c97cc626c..1cf681a9d 100644--- a/server/route/api/v2/auth_service.go+++ b/server/route/api/v2/auth_service.go@@ -30,7 +30,7 @@ func (s *APIV2Service) GetAuthStatus(ctx context.Context, _ *apiv2pb.GetAuthStatif user == nil {// Set the cookie header to expire access token.if err := s.clearAccessTokenCookie(ctx); err != nil {- return nil, status.Errorf(codes.Internal, "failed to set grpc header")+ return nil, status.Errorf(codes.Internal, "failed to set grpc header: %v", err)}return nil, status.Errorf(codes.Unauthenticated, "user not found")}diff --git a/server/route/api/v2/memo_service.go b/server/route/api/v2/memo_service.goindex bba8a887c..339020f88 100644--- a/server/route/api/v2/memo_service.go+++ b/server/route/api/v2/memo_service.go@@ -106,7 +106,7 @@ func (s *APIV2Service) ListMemos(ctx context.Context, request *apiv2pb.ListMemosmemoFind.Offset = &offsetmemos, err := s.Store.ListMemos(ctx, memoFind)if err != nil {- return nil, status.Errorf(codes.Internal, "failed to list memos")+ return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err)}memoMessages := []*apiv2pb.Memo{}@@ -459,7 +459,7 @@ func (s *APIV2Service) GetUserMemosStats(ctx context.Context, request *apiv2pb.Gmemos, err := s.Store.ListMemos(ctx, memoFind)if err != nil {- return nil, status.Errorf(codes.Internal, "failed to list memos")+ return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err)}location, err := time.LoadLocation(request.Timezone)@@ -494,12 +494,12 @@ func (s *APIV2Service) ExportMemos(ctx context.Context, request *apiv2pb.ExportMExcludeComments: true,}if err := s.buildMemoFindWithFilter(ctx, memoFind, request.Filter); err != nil {- return nil, status.Errorf(codes.Internal, "failed to build find memos with filter")+ return nil, status.Errorf(codes.Internal, "failed to build find memos with filter: %v", err)}memos, err := s.Store.ListMemos(ctx, memoFind)if err != nil {- return nil, status.Errorf(codes.Internal, "failed to list memos")+ return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err)}buf := new(bytes.Buffer)