mirror of
https://github.com/gravitational/teleport.git
synced 2026-11-02 14:59:53 +08:00
We were returning a trace.BadParameter, however we should return trace.IsNotFound. The godoc suggests that error. The tests suggests that error, but they were only matching for type which is the same for all the trace.XYZ errors. Tests are now using the `trace.Is<Error>` helper method to correctly validate the error message. The side effect of this change is that we were receiving a lot of logs when interpolating traits in a role. That log is supressed when the error is NotFound. That was not the case before this commit: the error was a BadParameter one, so the log is written (as debug, but still a lot of noise). Co-authored-by: Vitor Enes <vitor.duarte@goteleport.com>