Handling multiple errors #602
Labels
epic: usability-end-users
Relates to the usability of Topiary for endusers to use Topiary as a generic "good enough" formatter
P3
minor: not priorized
type: feature request
There are a number of improvements that could be made to the handling of multiple errors, which may arise during concurrent formatting:
The
CLIError::Multiple
variant is used to capture any number of failures from concurrent tasks (except when there is only one task). While the original error is logged when it happens, it is then discarded to collapse into this "all-or-nothing" error. This variant could be changed intoMultiple(Vec<TopiaryError>)
, to keep track of the original errors. This raises a number of questions:Error::source
for this variant?During concurrent formatting, if any task fails (and there is more than one task), then Topiary will log that multiple errors have occurred and exit with a non-zero exit code. This might not be a reasonable default: rather, this behaviour should be behind a CLI flag (e.g.,
--fail-on-multiple
). Alternatively, this behaviour could remain the default, but with the option to disable it (e.g.,--no-fail-on-multiple
).During concurrent formatting, it may be useful to allow Topiary to bail out on the first failure, rather than continuing with its other concurrent tasks until they've all finished/failed. This should be enabled through a CLI flag (e.g.,
--fail-fast
).💡 This issue depends on #583.
The text was updated successfully, but these errors were encountered: