Rework error messages
This commit reworks error messages for all commands and makes sure they pass liniting.
This commit is contained in:
parent
d22784e6f5
commit
c31c46ee44
40 changed files with 249 additions and 110 deletions
|
|
@ -35,19 +35,21 @@ var errPrefixUpdateFailed = exit.Error{
|
|||
ExitCode: exit.ExitGeneric,
|
||||
}
|
||||
|
||||
func (upc updateprefixconfig) Run(context wisski_distillery.Context) error {
|
||||
func (upc updateprefixconfig) Run(context wisski_distillery.Context) (err error) {
|
||||
defer errPrefixUpdateFailed.DeferWrap(&err)
|
||||
|
||||
dis := context.Environment
|
||||
|
||||
wissKIs, err := dis.Instances().All(context.Context)
|
||||
if err != nil {
|
||||
return errPrefixUpdateFailed.Wrap(err)
|
||||
return err
|
||||
}
|
||||
|
||||
return status.WriterGroup(context.Stderr, upc.Parallel, func(instance *wisski.WissKI, writer io.Writer) error {
|
||||
logging.Progress(writer, context.Context, "reading prefixes")
|
||||
err := instance.Prefixes().Update(context.Context)
|
||||
if err != nil {
|
||||
return errPrefixUpdateFailed.Wrap(err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}, wissKIs, status.SmartMessage(func(item *wisski.WissKI) string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue