Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: UX improvemnts on omit args & error handling #236

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

wey-gu
Copy link
Contributor

@wey-gu wey-gu commented Mar 15, 2024

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number: #162

Description:

  • only if 0 arguments are provided, localhostl:9669 with root user will be used
  • use exit or Fatal instead of Panic when any abnormal occurred
❯ ./nebula-console
Notice: Defaulting to localhost (127.0.0.1) with port 9669 using credentials (username: root, password: nebula).

Welcome!

(root@nebula) [(none)]>

❯ ./nebula-console -addr 10.1.1.168 -port 9669
Error: Invalid flags provided: the following required flags are missing or invalid: username
Tip: Use the --help option for guidance on correct flag usage.

❯ ./nebula-console -addr 10.1.1.168
Error: Invalid flags provided: the following required flags are missing or invalid: port, username
Tip: Use the --help option for guidance on correct flag usage.

Before, it's like this:

2024/03/15 08:29:13 Error: argument port is missed!
panic: Error: argument port is missed!

goroutine 1 [running]:
log.Panicf(0x7638b8, 0x1f, 0x0, 0x0, 0x0)
	/opt/hostedtoolcache/go/1.16.4/x64/src/log/log.go:361 +0xc5
main.validateFlags()
	/home/runner/work/nebula-console/nebula-console/main.go:467 +0x174
main.main()
	/home/runner/work/nebula-console/nebula-console/main.go:500 +0x10b

- only if 0 arguments provided, localhostl:9669 with root user will be used
- use exit or Fatal instead of Panic when any abornal occured
@wey-gu wey-gu requested review from kqzh, jievince and veezhang March 15, 2024 08:18
@jievince jievince merged commit 7de0ab9 into vesoft-inc:master Mar 15, 2024
9 checks passed
@wey-gu wey-gu deleted the omit_arguments branch March 15, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants