Repository: coinbase/rosetta-cli
Pull request #349 (2022-09-09 19:57:37)

Error handling improvement for configuration and results packages
Signed-off-by: Jingfu Wang <jingfu.wang@coinbase.com>

Error handling improvement for configuration and results packages

### Motivation
<!--
Does this solve a bug? Enable a new use-case? Improve an existing behavior? Concrete examples are helpful here.
-->

### Solution
<!--
What is the solution here from a high level. What are the key technical decisions and why were they made?
-->

### Open questions
<!--
(optional) Any open questions or feedback on design desired?
-->



Patch:
diff --git a/configuration/configuration.go b/configuration/configuration.go
index 02774a7..b2128a9 100644
--- a/configuration/configuration.go
+++ b/configuration/configuration.go
@@ -17,14 +17,13 @@ package configuration
 import (
 	"context"
 	"encoding/hex"
-	"errors"
 	"fmt"
 	"log"
 	"path"
 	"runtime"
 	"strings"
 
-	customerrors "github.com/coinbase/rosetta-cli/pkg/errors"
+	cliErrs "github.com/coinbase/rosetta-cli/pkg/errors"
 	"github.com/coinbase/rosetta-sdk-go/asserter"
 	"github.com/coinbase/rosetta-sdk-go/constructor/dsl"
 	"github.com/coinbase/rosetta-sdk-go/constructor/job"
@@ -213,11 +212,11 @@ func assertConstructionConfiguration(ctx context.Context, config *ConstructionCo
 	}
 
 	if len(config.Workflows) > 0 && len(config.ConstructorDSLFile) > 0 {
-		return fmt.Errorf("%w: cannot populate both workflows and DSL file path", customerrors.ErrParseFileFailed)
+		return cliErrs.ErrMultipleDSLFiles
 	}
 
 	if len(config.Workflows) == 0 && len(config.ConstructorDSLFile) == 0 {
-		return fmt.Errorf("%w: both workflows and DSL file path are empty", customerrors.ErrParseFileFailed)
+		return cliErrs.ErrNoDSLFile
 	}
 
 	// Compile ConstructorDSLFile and save to Workflows
@@ -225,7 +224,7 @@ func assertConstructionConfiguration(ctx context.Context, config *ConstructionCo
 		compiledWorkflows, err := dsl.Parse(ctx, config.ConstructorDSLFile)
 		if err != nil {
 			err.Log()
-			return fmt.Errorf("%w: compilation failed", err.Err)
+			return fmt.Errorf("DSL file is invalid, line %d, line contents %s: %w", err.Line, err.LineContents, err.Err)
 		}
 
 		config.Workflows = compiledWorkflows
@@ -236,10 +235,10 @@ func assertConstructionConfiguration(ctx context.Context, config *ConstructionCo
 		if workflow.Name == string(job.CreateAccount) || workflow.Name == string(job.RequestFunds) {
 			if workflow.Concurrency != job.ReservedWorkflowConcurrency {
 				return fmt.Errorf(
-					"%w: reserved workflow %s must have concurrency %d",
-					customerrors.ErrParseWorkflowFailed,
+					"DSL file is invalid, reserved workflow %s must have concurrency %d: %w",
 					workflow.Name,
 					job.ReservedWorkflowConcurrency,
+					cliErrs.ErrWrongWorkflowConcurrency,
 				)
 			}
 		}
@@ -250,20 +249,20 @@ func assertConstructionConfiguration(ctx context.Context, config *ConstructionCo
 		_, err := hex.DecodeString(account.PrivateKeyHex)
 		if err != nil {
 			return fmt.Errorf(
-				"%w: private key %s is not hex encoded for prefunded account",
-				err,
+				"private key %s is not hex encoded for prefunded account: %w",
 				account.PrivateKeyHex,
+				err,
 			)
 		}
 
 		// Checks if valid CurveType
 		if err := asserter.CurveType(account.CurveType); err != nil {
-			return fmt.Errorf("%w: invalid CurveType for prefunded account", err)
+			return fmt.Errorf("prefunded account curve type %s is invalid: %w", types.PrintStruct(account.CurveType), err)
 		}
 
 		// Checks if valid AccountIdentifier
 		if err := asserter.AccountIdentifier(account.AccountIdentifier); err != nil {
-			return fmt.Errorf("Account.Address is missing for prefunded account")
+			return fmt.Errorf("prefunded account identifier %s is invalid: %w", types.PrintStruct(account.AccountIdentifier), err)
 		}
 
 		// Check if valid Currency when Currency is specified
@@ -272,7 +271,7 @@ func assertConstructionConfiguration(ctx context.Context, config *ConstructionCo
 		if account.Currency != nil {
 			err = asserter.Currency(account.Currency)
 			if err != nil {
-				return fmt.Errorf("%w: invalid currency for prefunded account", err)
+				return fmt.Errorf("prefunded account currency %s is invalid: %w", types.PrintStruct(account.Currency), err)
 			}
 		}
 	}
@@ -282,11 +281,11 @@ func assertConstructionConfiguration(ctx context.Context, config *ConstructionCo
 
 func assertDataConfiguration(config *DataConfiguration) error { // nolint:gocognit
 	if config.StartIndex != nil && *config.StartIndex < 0 {
-		return fmt.Errorf("start index %d cannot be negative", *config.StartIndex)
+		return fmt.Errorf("start index %d is invalid: %w", *config.StartIndex, cliErrs.ErrNegativeStartIndex)
 	}
 
 	if !config.ReconciliationDisabled && config.BalanceTrackingDisabled {
-		return errors.New("balance tracking must be enabled to perform reconciliation")
+		return cliErrs.ErrBalanceTrackingIsDisabledForReconciliation
 	}
 
 	if config.EndConditions == nil {
@@ -295,45 +294,40 @@ func assertDataConfiguration(config *DataConfiguration) error { // nolint:gocogn
 
 	if config.EndConditions.Index != nil {
 		if *config.EndConditions.Index < 0 {
-			return fmt.Errorf("end index %d cannot be negative", *config.EndConditions.Index)
+			return fmt.Errorf("end index %d is invalid: %w", *config.EndConditions.Index, cliErrs.ErrNegativeEndIndex)
 		}
 	}
 
 	if config.EndConditions.ReconciliationCoverage != nil {
 		coverage := config.EndConditions.ReconciliationCoverage.Coverage
 		if coverage < 0 || coverage > 1 {
-			return fmt.Errorf("reconciliation coverage %f must be [0.0,1.0]", coverage)
+			return fmt.Errorf("reconciliation coverage %f is invalid: %w", coverage, cliErrs.ErrReconciliationOutOfRange)
 		}
 
 		index := config.EndConditions.ReconciliationCoverage.Index
 		if index != nil && *index < 0 {
-			return fmt.Errorf("reconciliation coverage height %d must be >= 0", *index)
+			return fmt.Errorf("reconciliation coverage index %d is invalid: %w", *index, cliErrs.ErrNegativeReconciliationCoverageIndex)
 		}
 
 		accountCount := config.EndConditions.ReconciliationCoverage.AccountCount
 		if accountCount != nil && *accountCount < 0 {
 			return fmt.Errorf(
-				"reconciliation coverage account count %d must be >= 0",
+				"reconciliation coverage account count %d is invalid: %w",
 				*accountCount,
+				cliErrs.ErrNegativeReconciliationCoverageAccountCount,
 			)
 		}
 
 		if config.BalanceTrackingDisabled {
-			return errors.New(
-				"balance tracking must be enabled for reconciliation coverage end condition",
-			)
+			return cliErrs.ErrBalanceTrackingIsDisabledForReconciliationCoverageEndCondition
 		}
 
 		if config.IgnoreReconciliationError {
-			return errors.New(
-				"reconciliation errors cannot be ignored for reconciliation coverage end condition",
-			)
+			return cliErrs.ErrReconciliationErrorIsIgnoredForReconciliationCoverageEndCondition
 		}
 
 		if config.ReconciliationDisabled {
-			return errors.New(
-				"reconciliation cannot be disabled for reconciliation coverage end condition",
-			)
+			return cliErrs.ErrReconciliationIsDisabledForReconciliationCoverageEndCondition
 		}
 	}
 
@@ -342,31 +336,31 @@ func assertDataConfiguration(config *DataConfiguration) error { // nolint:gocogn
 
 func assertConfiguration(ctx context.Context, config *Configuration) error {
 	if err := asserter.NetworkIdentifier(config.Network); err != nil {
-		return fmt.Errorf("%w: invalid network identifier", err)
+		return fmt.Errorf("invalid network identifier %s: %w", types.PrintStruct(config.Network), err)
 	}
 
 	if config.SeenBlockWorkers <= 0 {
-		return errors.New("seen_block_workers must be > 0")
+		return fmt.Errorf("the number of seen block workers %d is invalid: %w", config.SeenBlockWorkers, cliErrs.ErrNegativeSeenBlockWorkers)
 	}
 
 	if config.SerialBlockWorkers <= 0 {
-		return errors.New("serial_block_workers must be > 0")
+		return fmt.Errorf("the number of serial block workers %d is invalid: %w", config.SerialBlockWorkers, cliErrs.ErrNegativeSerialBlockWorkers)
 	}
 
 	if config.TableSize != nil && (*config.TableSize < 2 || *config.TableSize > 100) {
-		return fmt.Errorf("table_size %d is not in the range [2, 100], please check your input", *config.TableSize)
+		return fmt.Errorf("table size %d is invalid: %w", *config.TableSize, cliErrs.ErrTableSizeIsOutOfRange)
 	}
 
 	if config.ValueLogFileSize != nil && (*config.ValueLogFileSize < 128 || *config.ValueLogFileSize > 2048) {
-		return fmt.Errorf("value_log_file_size %d is not in the range [128, 2048], please check your input", *config.ValueLogFileSize)
+		return fmt.Errorf("value log file size %d is invalid: %w", *config.ValueLogFileSize, cliErrs.ErrValueLogFileSizeIsOutOfRange)
 	}
 
 	if err := assertDataConfiguration(config.Data); err != nil {
-		return fmt.Errorf("%w: invalid data configuration", err)
+		return fmt.Errorf("data configuration is invalid: %w", err)
 	}
 
 	if err := assertConstructionConfiguration(ctx, config.Construction); err != nil {
-		return fmt.Errorf("%w: invalid construction configuration", err)
+		return fmt.Errorf("construction configuration is invalid: %w", err)
 	}
 
 	return nil
@@ -410,7 +404,7 @@ func modifyFilePaths(config *Configuration, fileDir string) {
 func LoadConfiguration(ctx context.Context, filePath string) (*Configuration, error) {
 	var configRaw Configuration
 	if err := utils.LoadAndParse(filePath, &configRaw); err != nil {
-		return nil, fmt.Errorf("%w: unable to open configuration file", err)
+		return nil, fmt.Errorf("unable to load and parse configuration file: %w", err)
 	}
 
 	config := populateMissingFields(&configRaw)
@@ -421,7 +415,7 @@ func LoadConfiguration(ctx context.Context, filePath string) (*Configuration, er
 	modifyFilePaths(config, fileDir)
 
 	if err := assertConfiguration(ctx, config); err != nil {
-		return nil, fmt.Errorf("%w: invalid configuration", err)
+		return nil, fmt.Errorf("configuration is invalid: %w", err)
 	}
 
 	color.Cyan(
diff --git a/go.mod b/go.mod
index dcb81ec..1b0daef 100644
--- a/go.mod
+++ b/go.mod
@@ -3,9 +3,8 @@ module github.com/coinbase/rosetta-cli
 go 1.16
 
 require (
-	github.com/coinbase/rosetta-sdk-go v0.7.11
+	github.com/coinbase/rosetta-sdk-go v0.8.0
 	github.com/fatih/color v1.13.0
-	github.com/golang/protobuf v1.5.2 // indirect
 	github.com/google/go-cmp v0.5.6 // indirect
 	github.com/mattn/go-colorable v0.1.12 // indirect
 	github.com/olekukonko/tablewriter v0.0.5
@@ -14,6 +13,5 @@ require (
 	github.com/stretchr/testify v1.7.2
 	go.uber.org/zap v1.21.0
 	golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
-	golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect
 	google.golang.org/protobuf v1.27.1 // indirect
 )
diff --git a/go.sum b/go.sum
index 4db8ed0..b8dc479 100644
--- a/go.sum
+++ b/go.sum
@@ -26,6 +26,7 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3
 github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I=
 github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
 github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8=
@@ -97,8 +98,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
 github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304=
 github.com/coinbase/kryptology v1.8.0 h1:Aoq4gdTsJhSU3lNWsD5BWmFSz2pE0GlmrljaOxepdYY=
 github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI=
-github.com/coinbase/rosetta-sdk-go v0.7.11 h1:T7camDGstlX2ENVE0QHR1AVu3asSXED0vg1xDaF6bYE=
-github.com/coinbase/rosetta-sdk-go v0.7.11/go.mod h1:HLTqSTSnOGLWHGTxoUJQO2TLuKkas1B9i/7ByerK6lM=
+github.com/coinbase/rosetta-sdk-go v0.8.0 h1:FXootIYNrQyVbpGfWfmEOBzEGKku8Wuyql+iyIy3L+g=
+github.com/coinbase/rosetta-sdk-go v0.8.0/go.mod h1:tXPR6AIW9ogsH4tYIaFOKOgfJNanCvcyl7JKLd4DToc=
 github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ=
 github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI=
 github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q=
@@ -110,6 +111,7 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee
 github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
 github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
 github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
+github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
 github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
 github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg=
@@ -146,8 +148,8 @@ github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7j
 github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
 github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/ethereum/go-ethereum v1.10.19 h1:EOR5JbL4MD5yeOqv8W2iC1s4NximrTjqFccUz8lyBRA=
-github.com/ethereum/go-ethereum v1.10.19/go.mod h1:IJBNMtzKcNHPtllYihy6BL2IgK1u+32JriaTbdt4v+w=
+github.com/ethereum/go-ethereum v1.10.21 h1:5lqsEx92ZaZzRyOqBEXux4/UR06m296RGzN3ol3teJY=
+github.com/ethereum/go-ethereum v1.10.21/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg=
 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
 github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
 github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
@@ -195,9 +197,7 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x
 github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
 github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
 github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
-github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
 github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
-github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
 github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
 github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
@@ -214,7 +214,6 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
 github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
@@ -443,6 +442,7 @@ github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:s
 github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs=
 github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
 github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
+github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo=
 github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
 github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
 github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
@@ -453,6 +453,7 @@ github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV
 github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
 github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
 github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
+github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
 github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE=
 github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
@@ -547,8 +548,9 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
 golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
 golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY=
 golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20220607020251-c690dde0001d h1:4SFsTMi4UahlKoloni7L4eYzhFRifURQLw+yv0QDCx8=
+golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -608,10 +610,11 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E=
-golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
+golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
@@ -657,8 +660,9 @@ golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlz
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618=
+golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
 gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
 gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
 gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU=
@@ -691,22 +695,17 @@ google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvx
 google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
-google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
 google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
 google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
 google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
 google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
-google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
 google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
 google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
 google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
 google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
 google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
-google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
@@ -721,7 +720,6 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
 gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=
 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
-gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0=
 gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/pkg/errors/errors.go b/pkg/errors/errors.go
index a5f93b9..1b608be 100644
--- a/pkg/errors/errors.go
+++ b/pkg/errors/errors.go
@@ -18,32 +18,36 @@ import (
 	"errors"
 )
 
-// Configuration Errors
-
 var (
-	// Data Errors
-
-	ErrCheckStorageTipFailed = errors.New("unable to check storage tip")
+	// Configuration errors
+	ErrMultipleDSLFiles                                                  = errors.New("multiple DSL files are found")
+	ErrNoDSLFile                                                         = errors.New("no DSL file")
+	ErrWrongWorkflowConcurrency                                          = errors.New("reserved workflow concurrency doesn't match")
+	ErrNegativeStartIndex                                                = errors.New("start index is negative")
+	ErrNegativeEndIndex                                                  = errors.New("end index is negative")
+	ErrNegativeReconciliationCoverageIndex                               = errors.New("reconciliation coverage index is negative")
+	ErrNegativeReconciliationCoverageAccountCount                        = errors.New("reconciliation coverage account is negative")
+	ErrNegativeSeenBlockWorkers                                          = errors.New("the number of seen block workers is negative")
+	ErrNegativeSerialBlockWorkers                                        = errors.New("the number of serial block workers is negative")
+	ErrReconciliationOutOfRange                                          = errors.New("reconciliation is out of range, it must be in the range [0, 1]")
+	ErrTableSizeIsOutOfRange                                             = errors.New("table size is out of range, it must be in the range [2, 100]")
+	ErrValueLogFileSizeIsOutOfRange                                      = errors.New("value log file size is out of range, it must be in the range [128, 2048]")
+	ErrBalanceTrackingIsDisabledForReconciliation                        = errors.New("balance tracking cannot be disabled for reconciliation")
+	ErrBalanceTrackingIsDisabledForReconciliationCoverageEndCondition    = errors.New("balance tracking cannot be disabled for reconciliation coverage end condition")
+	ErrReconciliationErrorIsIgnoredForReconciliationCoverageEndCondition = errors.New("reconciliation error cannot be ignored for reconciliation coverage end condition")
+	ErrReconciliationIsDisabledForReconciliationCoverageEndCondition     = errors.New("reconciliation cannot be disabled for reconciliation coverage end condition")
+	ErrConstructionConfigMissing                                         = errors.New("construction configuration is missing")
+
+	// Data check errors
 	ErrDataCheckHalt         = errors.New("data check halted")
 	ErrInitDataTester        = errors.New("unexpected error occurred while trying to initialize data tester")
-
-	// Construction Configuration Errors
-
-	ErrParseFileFailed           = errors.New("unable to parse config files")
-	ErrBalanceTrackingDisabled   = errors.New("balance tracking disabled")
-	ErrReconciliationConfig      = errors.New("invalid reconciliation error")
-	ErrCompileDSLFileFailed      = errors.New("unable to compile DSL file")
-	ErrParseWorkflowFailed       = errors.New("unable to parse workflow")
-	ErrConstructionConfigMissing = errors.New("construction configuration is missing")
+	ErrReconciliationFailure = errors.New("reconciliation failure")
 
 	// Construction check errors
-
 	ErrConstructionCheckHalt = errors.New("construction check halted")
 
+	// Command errors
+	ErrBlockNotFound       = errors.New("block not found")
+	ErrNoAvailableNetwork  = errors.New("no networks available")
 	ErrAsserterConfigError = errors.New("asserter configuration validation failed")
-
-	// Bad Command Errors
-
-	ErrBlockNotFound      = errors.New("block not found")
-	ErrNoAvailableNetwork = errors.New("no networks available")
 )
diff --git a/pkg/processor/reconciler_handler.go b/pkg/processor/reconciler_handler.go
index 1352150..f7148b7 100644
--- a/pkg/processor/reconciler_handler.go
+++ b/pkg/processor/reconciler_handler.go
@@ -22,8 +22,8 @@ import (
 	"time"
 
 	"github.com/coinbase/rosetta-cli/pkg/logger"
-	"github.com/coinbase/rosetta-cli/pkg/results"
 
+	cliErrs "github.com/coinbase/rosetta-cli/pkg/errors"
 	"github.com/coinbase/rosetta-sdk-go/reconciler"
 	"github.com/coinbase/rosetta-sdk-go/storage/modules"
 	"github.com/coinbase/rosetta-sdk-go/types"
@@ -162,7 +162,7 @@ func (h *ReconcilerHandler) ReconciliationFailed(
 			h.InactiveFailureBlock = block
 			return fmt.Errorf(
 				"%w: inactive reconciliation error for %s at %d (computed: %s%s, live: %s%s)",
-				results.ErrReconciliationFailure,
+				cliErrs.ErrReconciliationFailure,
 				account.Address,
 				block.Index,
 				computedBalance,
@@ -176,7 +176,7 @@ func (h *ReconcilerHandler) ReconciliationFailed(
 		h.ActiveFailureBlock = block
 		return fmt.Errorf(
 			"%w: active reconciliation error for %s at %d (computed: %s%s, live: %s%s)",
-			results.ErrReconciliationFailure,
+			cliErrs.ErrReconciliationFailure,
 			account.Address,
 			block.Index,
 			computedBalance,
diff --git a/pkg/results/construction_results.go b/pkg/results/construction_results.go
index 4761a53..e578b26 100644
--- a/pkg/results/construction_results.go
+++ b/pkg/results/construction_results.go
@@ -287,7 +287,7 @@ func ComputeCheckConstructionStatus(
 func FetchCheckConstructionStatus(url string) (*CheckConstructionStatus, error) {
 	var status CheckConstructionStatus
 	if err := JSONFetch(url, &status); err != nil {
-		return nil, fmt.Errorf("%w: unable to fetch construction status", err)
+		return nil, fmt.Errorf("unable to fetch check construction status: %w", err)
 	}
 
 	return &status, nil
diff --git a/pkg/results/data_results.go b/pkg/results/data_results.go
index 1c2f98e..6ba9251 100644
--- a/pkg/results/data_results.go
+++ b/pkg/results/data_results.go
@@ -27,6 +27,7 @@ import (
 
 	"github.com/coinbase/rosetta-cli/configuration"
 
+	cliErrs "github.com/coinbase/rosetta-cli/pkg/errors"
 	"github.com/coinbase/rosetta-sdk-go/asserter"
 	"github.com/coinbase/rosetta-sdk-go/fetcher"
 	"github.com/coinbase/rosetta-sdk-go/reconciler"
@@ -429,7 +430,7 @@ func ComputeCheckDataStatus(
 func FetchCheckDataStatus(url string) (*CheckDataStatus, error) {
 	var status CheckDataStatus
 	if err := JSONFetch(url, &status); err != nil {
-		return nil, fmt.Errorf("%w: unable to fetch construction status", err)
+		return nil, fmt.Errorf("unable to fetch check data status: %w", err)
 	}
 
 	return &status, nil
@@ -511,9 +512,7 @@ func (c *CheckDataTests) Print() {
 // a non-500 response.
 func RequestResponseTest(err error) bool {
 	return !(fetcher.Err(err) ||
-		errors.Is(err, utils.ErrNetworkNotSupported) ||
-		errors.Is(err, syncer.ErrGetNetworkStatusFailed) ||
-		errors.Is(err, syncer.ErrFetchBlockFailed))
+		errors.Is(err, utils.ErrNetworkNotSupported))
 }
 
 // ResponseAssertionTest returns a boolean
@@ -569,7 +568,7 @@ func ReconciliationTest(
 	reconciliationsPerformed bool,
 	reconciliationsFailed bool,
 ) *bool {
-	if errors.Is(err, ErrReconciliationFailure) {
+	if errors.Is(err, cliErrs.ErrReconciliationFailure) {
 		return &f
 	}
 
diff --git a/pkg/results/types.go b/pkg/results/types.go
index 6057ef6..a421592 100644
--- a/pkg/results/types.go
+++ b/pkg/results/types.go
@@ -14,18 +14,7 @@
 
 package results
 
-import (
-	"errors"
-)
-
 const (
 	// TimeElapsedCounter tracks the total time elapsed in seconds.
 	TimeElapsedCounter = "time_elapsed"
 )
-
-var (
-	// ErrReconciliationFailure is returned if reconciliation fails.
-	// TODO: Move to reconciler package (had to remove from processor
-	// to prevent circular dependency)
-	ErrReconciliationFailure = errors.New("reconciliation failure")
-)
diff --git a/pkg/results/utils.go b/pkg/results/utils.go
index d9eeef4..e9de29a 100644
--- a/pkg/results/utils.go
+++ b/pkg/results/utils.go
@@ -21,26 +21,26 @@ import (
 	"net/http"
 )
 
-// JSONFetch makes a GET request to the URL and marshals
+// JSONFetch makes a GET request to the URL and unmarshal
 // the response into output.
 func JSONFetch(url string, output interface{}) error {
 	resp, err := http.Get(url) // #nosec
 	if err != nil {
-		return fmt.Errorf("%w: unable to fetch GET %s", err, url)
+		return fmt.Errorf("unable to fetch url %s: %w", url, err)
 	}
 	defer resp.Body.Close()
 
 	body, err := ioutil.ReadAll(resp.Body)
 	if err != nil {
-		return fmt.Errorf("%w: unable to read body", err)
+		return fmt.Errorf("unable to read body: %w", err)
 	}
 
 	if resp.StatusCode != http.StatusOK {
-		return fmt.Errorf("received %d status with body %s", resp.StatusCode, body)
+		return fmt.Errorf("received %d status with body %s", resp.StatusCode, string(body))
 	}
 
 	if err := json.Unmarshal(body, output); err != nil {
-		return fmt.Errorf("%w: unable to unmarshal JSON", err)
+		return fmt.Errorf("unable to unmarshal: %w", err)
 	}
 
 	return nil


Test patch:
diff --git a/pkg/results/data_results_test.go b/pkg/results/data_results_test.go
index 9d68781..b5816fc 100644
--- a/pkg/results/data_results_test.go
+++ b/pkg/results/data_results_test.go
@@ -24,6 +24,7 @@ import (
 
 	"github.com/coinbase/rosetta-cli/configuration"
 
+	cliErrs "github.com/coinbase/rosetta-cli/pkg/errors"
 	"github.com/coinbase/rosetta-sdk-go/asserter"
 	"github.com/coinbase/rosetta-sdk-go/fetcher"
 	sdkMocks "github.com/coinbase/rosetta-sdk-go/mocks/storage/modules"
@@ -123,20 +124,6 @@ func TestComputeCheckDataResults(t *testing.T) {
 				},
 			},
 		},
-		"default configuration, no storage, syncer and fetch errors": {
-			cfg: configuration.DefaultConfiguration(),
-			err: []error{
-				syncer.ErrGetNetworkStatusFailed,
-				syncer.ErrFetchBlockFailed,
-			},
-			result: &CheckDataResults{
-				Tests: &CheckDataTests{
-					RequestResponse:   false,
-					ResponseAssertion: true,
-					BlockSyncing:      &f,
-				},
-			},
-		},
 		"default configuration, no storage, assertion errors": {
 			cfg: configuration.DefaultConfiguration(),
 			err: []error{asserter.ErrAmountValueMissing},
@@ -327,7 +314,7 @@ func TestComputeCheckDataResults(t *testing.T) {
 		},
 		"default configuration, no storage, reconciliation errors": {
 			cfg: configuration.DefaultConfiguration(),
-			err: []error{ErrReconciliationFailure},
+			err: []error{cliErrs.ErrReconciliationFailure},
 			result: &CheckDataResults{
 				Tests: &CheckDataTests{
 					RequestResponse:   true,
@@ -338,7 +325,7 @@ func TestComputeCheckDataResults(t *testing.T) {
 		},
 		"default configuration, counter storage, reconciliation errors": {
 			cfg:                    configuration.DefaultConfiguration(),
-			err:                    []error{ErrReconciliationFailure},
+			err:                    []error{cliErrs.ErrReconciliationFailure},
 			provideCounterStorage:  true,
 			activeReconciliations:  10,
 			reconciliationFailures: 19,
@@ -387,7 +374,7 @@ func TestComputeCheckDataResults(t *testing.T) {
 				var testErr error
 				if err != nil {
 					testName = err.Error()
-					testErr = fmt.Errorf("%w: test wrapping", err)
+					testErr = fmt.Errorf("test wrapping: %w", err)
 					test.result.Error = testErr.Error()
 				}
 
diff --git a/pkg/results/utils_test.go b/pkg/results/utils_test.go
index ed63a9c..8079600 100644
--- a/pkg/results/utils_test.go
+++ b/pkg/results/utils_test.go
@@ -46,7 +46,7 @@ func TestJSONFetch(t *testing.T) {
 		"not JSON": {
 			status:        http.StatusOK,
 			body:          `hello`,
-			expectedError: "invalid character 'h' looking for beginning of value: unable to unmarshal JSON",
+			expectedError: "unable to unmarshal: invalid character 'h' looking for beginning of value",
 		},
 	}