From b5fd6d053463c7509a698e6382b5412482927ec8 Mon Sep 17 00:00:00 2001 From: Kylesoda <249518290+kylesoda@users.noreply.github.com> Date: Fri, 8 May 2026 23:32:07 -0500 Subject: [PATCH] refactor: remove unused LoaderError type and associated file; streamline error handling structure --- cmd/go_migrate/process.go | 2 +- internal/app/custom_errors/loader.error.go | 14 -------------- .../custom_errors/{extractor.error.go => types.go} | 9 +++++++++ internal/app/etl/transformers/types.go | 1 - 4 files changed, 10 insertions(+), 16 deletions(-) delete mode 100644 internal/app/custom_errors/loader.error.go rename internal/app/custom_errors/{extractor.error.go => types.go} (69%) delete mode 100644 internal/app/etl/transformers/types.go diff --git a/cmd/go_migrate/process.go b/cmd/go_migrate/process.go index 1210f1c..5c48c87 100644 --- a/cmd/go_migrate/process.go +++ b/cmd/go_migrate/process.go @@ -112,7 +112,7 @@ func processMigrationJob( } chJobErrors := make(chan custom_errors.JobError, jobErrorsChannelSize) - chPartitions := make(chan models.Partition, job.ExtractorQueueSize) + chPartitions := make(chan models.Partition) chBatchesRaw := make(chan models.Batch, job.ExtractorQueueSize) chBatchesTransformed := make(chan models.Batch, job.TransformerQueueSize) diff --git a/internal/app/custom_errors/loader.error.go b/internal/app/custom_errors/loader.error.go deleted file mode 100644 index 1c12c2e..0000000 --- a/internal/app/custom_errors/loader.error.go +++ /dev/null @@ -1,14 +0,0 @@ -package custom_errors - -import ( - "git.ksdemosapps.com/kylesoda/go-migrate/internal/app/models" -) - -type LoaderError struct { - Batch models.Batch - Msg string -} - -func (e *LoaderError) Error() string { - return e.Msg -} diff --git a/internal/app/custom_errors/extractor.error.go b/internal/app/custom_errors/types.go similarity index 69% rename from internal/app/custom_errors/extractor.error.go rename to internal/app/custom_errors/types.go index 1ab5888..10b8cfb 100644 --- a/internal/app/custom_errors/extractor.error.go +++ b/internal/app/custom_errors/types.go @@ -14,3 +14,12 @@ type ExtractorError struct { func (e *ExtractorError) Error() string { return e.Msg } + +type LoaderError struct { + Batch models.Batch + Msg string +} + +func (e *LoaderError) Error() string { + return e.Msg +} diff --git a/internal/app/etl/transformers/types.go b/internal/app/etl/transformers/types.go deleted file mode 100644 index b3fa142..0000000 --- a/internal/app/etl/transformers/types.go +++ /dev/null @@ -1 +0,0 @@ -package transformers