remove unused router level output

This commit is contained in:
Joel Wetzell
2026-05-19 21:46:48 -05:00
parent 7913f5febc
commit 06a2a156c5
4 changed files with 2 additions and 71 deletions
-3
View File
@@ -6,12 +6,9 @@ import (
type RouteIO interface {
HandleInput(ctx context.Context, sourceId string, payload any) (bool, []RouteIOError)
HandleOutput(ctx context.Context, destinationId string, payload any) error
}
type RouteIOError struct {
Index int `json:"index"`
OutputError error `json:"outputError"`
ProcessError error `json:"processError"`
InputError error `json:"inputError"`
}
-12
View File
@@ -29,9 +29,7 @@ type HTTPServer struct {
type ResponseIOError struct {
Index int `json:"index"`
OutputError *string `json:"outputError"`
ProcessError *string `json:"processError"`
InputError *string `json:"inputError"`
}
type IOResponseData struct {
@@ -116,21 +114,11 @@ func (hs *HTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
Index: responseIOError.Index,
}
if responseIOError.InputError != nil {
errorMsg := responseIOError.InputError.Error()
errorToAdd.InputError = &errorMsg
}
if responseIOError.ProcessError != nil {
errorMsg := responseIOError.ProcessError.Error()
errorToAdd.ProcessError = &errorMsg
}
if responseIOError.OutputError != nil {
errorMsg := responseIOError.OutputError.Error()
errorToAdd.OutputError = &errorMsg
}
response.IOErrors = append(response.IOErrors, errorToAdd)
}
+2 -6
View File
@@ -32,10 +32,6 @@ func (mr *MockRouter) HandleInput(ctx context.Context, sourceId string, payload
return false, []common.RouteIOError{}
}
func (mr *MockRouter) HandleOutput(ctx context.Context, destinationId string, payload any) error {
return nil
}
func TestGoodRouteHandleInput(t *testing.T) {
routeConfig := config.RouteConfig{
Input: "input",
@@ -101,7 +97,7 @@ func TestRouteHandleInputWithProcessorError(t *testing.T) {
Payload: inputData,
})
if err == nil {
t.Fatalf("route HandleOutput did not return error for bad processor")
t.Fatalf("route did not return error for bad processor")
}
}
@@ -162,7 +158,7 @@ func TestRouteHandleNilPayloadFromProcessor(t *testing.T) {
Payload: "test",
})
if err != nil {
t.Fatalf("route HandleOutput returned error for nil payload: %v", err)
t.Fatalf("route returned error for nil payload: %v", err)
}
}