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
Retrieve errors when exitOnError
is set to false
#48
Comments
The problem with I think having all errors in one place and still be able to |
Yes, |
@okonet So from what I understand is that you want the main process to throw after all the tasks have executed so you would end up in the catch? |
Yeah, I think that would be the appropriate behavior for it. |
Yeah, that actually makes sense. Just wondering what I should throw though. A custom error object and attach the error list. const err = new ListrError('Some tasks might have failed');
err.errors = errorList;
throw err; |
That makes sense to me. The |
Yes exactly. |
And maybe it makes sense to also attach the |
Yes, it totally makes sense! |
Looks good to me 👍 |
Released in |
Awesome! Thanks for the work. I'm integrating it now. |
Let me know how it went ! |
Worked like a breeze: lint-staged/lint-staged#131. Thanks again for your work! |
From @okonet
Because
exitOnError
is set tofalse
, at the end, the.catch
function is not being invoked and you end up inthen
. Because the result of the promise is the context object, we could add anerrors
array and push all the errors into that list. A downside of this approach though is that we should make it a read-only property so that people can't overwrite that property.@okonet @frederickfogerty thoughts?
The text was updated successfully, but these errors were encountered: