Cleanup error messages

This commit is contained in:
Peter Stuifzand 2018-12-08 15:36:50 +01:00
parent 17bee2852a
commit 81adf6bbca
Signed by: peter
GPG Key ID: 374322D56E5209E8
3 changed files with 5 additions and 5 deletions

View File

@ -116,7 +116,7 @@ func loadEndpoints(c *client.Client, me *url.URL, filename string) error {
}
if endpoints.MicrosubEndpoint == "" {
return fmt.Errorf("Microsub Endpoint is missing")
return fmt.Errorf("microsub endpoint is missing")
}
u, err := url.Parse(endpoints.MicrosubEndpoint)

View File

@ -106,7 +106,7 @@ func newMainHandler(backend *memoryBackend) (*mainHandler, error) {
templateDir := os.Getenv("EKSTER_TEMPLATES")
if templateDir == "" {
return nil, fmt.Errorf("Missing env var EKSTER_TEMPLATES")
return nil, fmt.Errorf("missing env var EKSTER_TEMPLATES")
}
templateDir = strings.TrimRight(templateDir, "/")

View File

@ -242,7 +242,7 @@ func (b *memoryBackend) ChannelsUpdate(uid, name string) (microsub.Channel, erro
return c, nil
}
return microsub.Channel{}, fmt.Errorf("Channel %s does not exist", uid)
return microsub.Channel{}, fmt.Errorf("channel %s does not exist", uid)
}
// ChannelsDelete deletes a channel
@ -568,14 +568,14 @@ func (b *memoryBackend) MarkRead(channel string, uids []string) error {
args := redis.Args{}.Add(channelKey).AddFlat(itemUIDs)
if _, err := conn.Do("SADD", args...); err != nil {
return fmt.Errorf("Marking read for channel %s has failed: %s", channel, err)
return fmt.Errorf("marking read for channel %s has failed: %s", channel, err)
}
zchannelKey := fmt.Sprintf("zchannel:%s:posts", channel)
args = redis.Args{}.Add(zchannelKey).AddFlat(itemUIDs)
if _, err := conn.Do("ZREM", args...); err != nil {
return fmt.Errorf("Marking read for channel %s has failed: %s", channel, err)
return fmt.Errorf("marking read for channel %s has failed: %s", channel, err)
}
err := b.updateChannelUnreadCount(conn, channel)