featurebase/cmd
Seebs c681642734 Distinguish between usage errors and other errors
Cobra automatically displays usage messages, and also a gratuitous
"Error: [...]" line in some cases, when any error at all occurs
running a command. To suppress the usage message, you have to set
cmd.SilenceUsage to true. But the code that would do this doesn't
have access to it. To address this, we introduce a category of
"usage error", implemented with stdlib error wrapping (%w) and
use errors.Is to check for it. There's also utility functions
to do this checking automatically, or indeed, to handle wrapping
of the ctl.SomethingCommand and handle running it with a suitable
context and everything.

In fact, several of the places we're checking for usage errors,
we can never actually report one, but we're checking consistently
so that if we want to report usage errors, we can.

For instance, server.Start and (dax)server.Start don't ever
return usage errors, right now, but we're checking their responses
anyway.
2022-11-18 13:41:45 -06:00
..
badloader staticcheck fixes (#2278) 2022-11-07 10:51:55 -06:00
featurebase [FB-1444] Add sentry.io for error and perf monitoring (#2099) 2022-06-06 18:29:32 -05:00
featurebase-parse-sql added /sql endpoint; implemented SHOW TABLES (#1935) 2022-08-31 13:01:05 -07:00
pilosa-bench staticcheck fixes (#2278) 2022-11-07 10:51:55 -06:00
roaring-migrate staticcheck fixes (#2278) 2022-11-07 10:51:55 -06:00
slurp staticcheck fixes (#2278) 2022-11-07 10:51:55 -06:00
auth_token.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
backup.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
backup_tar.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
chksum.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
cli.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
config.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
dax.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
doc.go add copyright notice back in 2021-12-10 11:01:04 -06:00
export.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
export_test.go Upgrade go.mod to featurebase/v3 2022-01-21 10:57:05 -07:00
generate_config.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
import.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
import_test.go Add DAX - full list of squashed commits below 2022-11-16 11:19:40 -06:00
keygen.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
rbf.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
restore.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
restore_tar.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
root.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
root_test.go drop ioutil 2022-09-23 16:56:27 -05:00
server.go Distinguish between usage errors and other errors 2022-11-18 13:41:45 -06:00
server_test.go remove unused env var from test 2022-02-11 12:02:10 -06:00