Skip to content

Commit

Permalink
Improved error reporting in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
maoueh committed Jun 3, 2022
1 parent 65b3740 commit b10966f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions cmd/substreams/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package main
import (
"fmt"
"strings"

"github.com/streamingfast/derr"
)

// Commit sha1 value, injected via go build `ldflags` at build time
Expand All @@ -19,7 +17,10 @@ var date = ""
func main() {
rootCmd.Version = computeVersionString(version, commit, date)
setup()
derr.Check("substreams", rootCmd.Execute())

if err := rootCmd.Execute(); err != nil {

}
}

func computeVersionString(version, commit, date string) string {
Expand Down
2 changes: 0 additions & 2 deletions cmd/substreams/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ func runRun(cmd *cobra.Command, args []string) error {
fmt.Printf("RETURN HANDLER ERROR: %s\n", err)
}
}

return nil
}

func defaultOutputMode(outputMode string) (string, error) {
Expand Down
4 changes: 4 additions & 0 deletions docs/release-notes/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## Unreleased

### `substreams` CLI

* Do log last error when the CLI exit with an error has the error is already printed to the user and it creates a weird behavior.

## [v0.0.11](https://github.com/streamingfast/substreams/releases/tag/v0.0.11)

### `substreams` Docker
Expand Down

0 comments on commit b10966f

Please sign in to comment.