Skip to content

Commit 56e9ecd

Browse files
authored
feat: more debug logging when Watch retries (#627)
1 parent fc49cf5 commit 56e9ecd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/commands/watch.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func RegisterWatchCmd(rootCmd *cobra.Command) *cobra.Command {
3333
Short: "Watches the stream of relationship updates and schema updates from the server",
3434
Args: ValidationWrapper(cobra.RangeArgs(0, 2)),
3535
RunE: watchCmdFunc,
36-
Deprecated: "please use `zed relationships watch` instead",
36+
Deprecated: "please use `zed relationship watch` instead",
3737
}
3838

3939
rootCmd.AddCommand(watchCmd)
@@ -119,16 +119,17 @@ func watchCmdFuncImpl(cmd *cobra.Command, watchClient v1.WatchServiceClient, pro
119119
default:
120120
resp, err := watchStream.Recv()
121121
if err != nil {
122+
log.Debug().Err(err).Msg("error receiving from Watch stream")
122123
ok, err := isRetryable(err)
123124
if !ok {
124125
return err
125126
}
126127

127-
log.Trace().Err(err).Msg("will retry from the last known revision " + watchRevision)
128+
log.Debug().Err(err).Msg("will retry from the last known revision " + watchRevision)
128129
req.OptionalStartCursor = &v1.ZedToken{Token: watchRevision}
129130
watchStream, err = watchClient.Watch(ctx, req)
130131
if err != nil {
131-
return err
132+
return fmt.Errorf("error retrying the Watch call: %w", err)
132133
}
133134
continue
134135
}

0 commit comments

Comments
 (0)