diff --git a/go.mod b/go.mod index 9d4c7a7..886ca0f 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,9 @@ module github.com/transparency-dev/serverless-log go 1.21 require ( + github.com/gdamore/tcell/v2 v2.7.1 github.com/google/go-cmp v0.6.0 + github.com/rivo/tview v0.0.0-20240413115534-b0d41c484b95 github.com/transparency-dev/formats v0.0.0-20230914071414-5732692f1e50 github.com/transparency-dev/merkle v0.0.2 golang.org/x/mod v0.17.0 @@ -13,11 +15,9 @@ require ( require ( github.com/gdamore/encoding v1.0.0 // indirect - github.com/gdamore/tcell/v2 v2.7.1 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/rivo/tview v0.0.0-20240413115534-b0d41c484b95 // indirect github.com/rivo/uniseg v0.4.7 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/term v0.17.0 // indirect diff --git a/hammer/hammer.go b/hammer/hammer.go index dd7806b..25d85dc 100644 --- a/hammer/hammer.go +++ b/hammer/hammer.go @@ -17,6 +17,7 @@ package main import ( "context" + "errors" "flag" "fmt" "io" @@ -191,6 +192,10 @@ func (h *Hammer) Run(ctx context.Context) { _, _, _, err := h.tracker.Update(ctx) if err != nil { klog.Warning(err) + inconsistentErr := client.ErrInconsistency{} + if errors.As(err, &inconsistentErr) { + klog.Fatalf("Last Good Checkpoint:\n%s\n\nFirst Bad Checkpoint:\n%s\n\n%v", string(inconsistentErr.SmallerRaw), string(inconsistentErr.LargerRaw), inconsistentErr) + } } newSize := h.tracker.LatestConsistent.Size if newSize > size {