Commit c373c61
committed
cmd/docker: print command error before running plugin hooks
Plugin hook output (such as Gordon's "What's next:" hint) was rendered
before the command's own error message because hooks were invoked inside
runDocker while the error was only printed in main() after runDocker
returned.
Print the error to stderr before invoking the hooks, and replace the
error with a status-only StatusError so main() does not print the same
message a second time. The original error message is captured up-front
and still passed to the plugin hooks.
Closes #6973
Signed-off-by: Mohammed Olabie <olabiedev@gmail.com>1 parent ba93f0d commit c373c61
1 file changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
546 | 560 | | |
547 | 561 | | |
548 | 562 | | |
549 | | - | |
| 563 | + | |
550 | 564 | | |
551 | 565 | | |
552 | 566 | | |
| |||
0 commit comments