nuke icon indicating copy to clipboard operation
nuke copied to clipboard

Access to IProcess on ProcessException

Open ron-myers opened this issue 7 years ago • 3 comments

Within our build process, there are several command-line tools we call. Some of of these tools fail in known ways that should not stop the build from continuing. For example, dotnet nuget push with duplicate packages and other internal tools have specific ExitCodes they return based on the response type. Depending on the exitcode of the used tool, the overall build should or should not continue.

When these tools are called via Nuke, ProcessException(which inherits from Exception and has an internal IProcess property) is thrown. This leave us with, as I see it, the options:

  1. completeOnFailure: true - which may catch false negatives.
  2. try catch and parse the error messages (ugly but our current approach)
  3. fail the build on these non-failure cases

There may be another available approach that we have missed. I am happy to investigate another approach and/or submit a pull request for this change.

ron-myers avatar Sep 04 '19 18:09 ron-myers

We also have this in our build process. In particular, the issue has been thrown up when checking in files via tf.exe. The process can throw a non-critical error when there are no actual changes in the checked-in files.

Currently, our build process fails on such errors, when actually, we would like it to continue whilst outputting a warning rather than an error. Currently, the only way I can see of doing this is to parse the output manually, whereas it would be nice to be able catch the error and handle the exit code manually.

hdougie avatar Oct 21 '19 16:10 hdougie

#326

matkoch avatar Oct 22 '19 15:10 matkoch

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Nov 20 '19 00:11 lock[bot]