-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
Add infrastructure to augment ProcessExecutionFailure
#13865
Comments
I was looking for a way to add some additional context to the For me it makes sense to present it something like this:
So that the additional information is at the end, i.e. in case of a lot of output etc on stdout/stderr, it will still be on screen. |
Cool, that's what I was envisioning too. My only question is how to delimit what is Pants vs the process itself. Maybe something like |
There's no clear delimiter between stdout and stderr either. And too much delimitation may cause the information to disconnect too much. How about indenting all lines from the stdout/stderr, say two (or four, or one tab?) spaces, so each line that begins flushed left is all the default delimitation we need.. |
There are at least two instances where we want to be able to dynamically enrich failed processes with Pants-specific information: #11941 and #13136.
When enriching, we still want to preserve the original
ProcessExecutionFailure
though, as it's proved useful for debugging how we dump the argv and std{out,err}.I suggest that when call sites want to enrich a failure, they should switch from using
ProcessResult
toFallibleProcessResult
, and then manually raiseProcessExecutionFailure
rather than relying on this rule to do it automatically:pants/src/python/pants/engine/process.py
Lines 246 to 270 in 189c933
ProcessExecutionFailure
can have a new argument likeextra_info: str
(orlist[str]
) that gets added to the resulting error message. TBD whether it should be prepended or appended, and how the delimiter should look.--
I suggest a prework change to add the classmethod
ProcessExecutionFailure.from_process(process: FallibleProcessResult)
for DRY.The text was updated successfully, but these errors were encountered: