Add tests for trace registry

This commit is contained in:
Brian Goff
2018-09-20 16:48:57 -07:00
parent 67c3922863
commit 2fc82818ae
2 changed files with 47 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import (
"net/http"
"os"
"github.com/cpuguy83/strongerrors"
"github.com/pkg/errors"
"github.com/virtual-kubelet/virtual-kubelet/log"
"go.opencensus.io/trace"
@@ -42,7 +43,7 @@ func RegisterTracingExporter(name string, f TracingExporterInitFunc) {
func GetTracingExporter(name string, opts TracingExporterOptions) (trace.Exporter, error) {
f, ok := tracingExporters[name]
if !ok {
return nil, errors.Errorf("tracing exporter %q not found", name)
return nil, strongerrors.NotFound(errors.Errorf("tracing exporter %q not found", name))
}
return f(opts)
}