InterceptNotFound checks for errors ending with "not found." and wraps them as gRPC NotFound.
(err error)
| 105 | // InterceptNotFound checks for errors ending with "not found." |
| 106 | // and wraps them as gRPC NotFound. |
| 107 | func InterceptNotFound(err error) error { |
| 108 | if err != nil && strings.HasSuffix(err.Error(), "not found.") { |
| 109 | return status.Error(codes.NotFound, err.Error()) |
| 110 | } |
| 111 | return err |
| 112 | } |
no test coverage detected