Skip to content

Commit

Permalink
Return a better error on session recording lookup
Browse files Browse the repository at this point in the history
Instead of `0 not found`, return an error earlier, when loading index
files.
  • Loading branch information
Andrew Lytvynov authored and awly committed Jun 26, 2020
1 parent 46f1d87 commit b128000
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/events/auditlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,11 @@ func readSessionIndex(dataDir string, authServers []string, namespace string, si
return nil, trace.Wrap(err)
}
}

if len(index.indexFiles) == 0 {
return nil, trace.NotFound("session %q not found", sid)
}

index.sort()
return &index, nil
}
Expand Down

0 comments on commit b128000

Please sign in to comment.