Skip to content

Need better error message than stacktrace dump #138

Description

@chenrui333

Problem

When trying to run tx pull with misconfigured .tx/config, I saw some stacktrace dump as below

# Getting info about resources

panic: runtime error: integer divide by zero

goroutine 1 [running]:
github.com/transifex/cli/pkg/worker_pool.makeProgressBar(0x0, 0x0, 0x140001128a0, 0x140001faa00)
	/home/runner/work/cli/cli/pkg/worker_pool/main.go:249 +0x18c
github.com/transifex/cli/pkg/worker_pool.(*Pool).Start(0x140001faa00)
	/home/runner/work/cli/cli/pkg/worker_pool/main.go:228 +0x2d8
github.com/transifex/cli/internal/txlib.PullCommand(0x140001fe450, 0x1400013c5a0, 0x14000206280, 0x0, 0x0)
	/home/runner/work/cli/cli/internal/txlib/pull.go:63 +0x320
github.com/transifex/cli/cmd/tx.Main.func5(0x140001fa900, 0x13, 0x24)
	/home/runner/work/cli/cli/cmd/tx/main.go:592 +0xa04
github.com/urfave/cli/v2.(*Command).Run(0x140001f6000, 0x140001fa140, 0x0, 0x0)
	/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 +0x3c8
github.com/urfave/cli/v2.(*App).RunContext(0x14000123d40, 0x1053318a0, 0x14000136008, 0x14000110050, 0x5, 0x5, 0x0, 0x0)
	/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 +0x5ec
github.com/urfave/cli/v2.(*App).Run(...)
	/home/runner/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224
github.com/transifex/cli/cmd/tx.Main()
	/home/runner/work/cli/cli/cmd/tx/main.go:1029 +0x266c
main.main()
	/home/runner/work/cli/cli/main.go:5 +0x20

I would be better to display more user-friendly error messages rather than the stacktrace dump.

Activity

  1. codegaze commented on Dec 13, 2022

    @codegaze
    Contributor

    Hello @chenrui333, thanks for bringing this to our attention.
    Could you please provide a txconfig example that can reproduce this behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    will be tackledIt's in our radar to tackle in a future release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions