Skip to content
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

Skyline: Include process output in ProcessRunner exceptions when it… #2731

Merged
merged 5 commits into from Oct 2, 2023

Conversation

brendanx67
Copy link
Contributor

…would otherwise be lost

  • for diagnosing method export failures

…ould otherwise be lost

- for diagnosing method export failures
@brendanx67
Copy link
Contributor Author

Not sure we will merge this to master, but it may be useful in diagnosing a current support request on a failure exporting Waters methods.

@brendanx67
Copy link
Contributor Author

I think we could merge this now. It puts the output into a nested IOException so that the message doesn't change but the output is available if the user clicks More Info. One thing I am unsure about is that I did this only for IOException, since I didn't want to write another WrapAndThrowException and I didn't want to lose the exception type in the throw that wraps the exception.

Copy link
Contributor

@nickshulman nickshulman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

It's unfortunate that the way "CommandLine.ExportInstrumentFile" is currently written, it will catch IOException and throw away this new extra information:

            catch (IOException x)
            {
                _out.WriteLine(Resources.CommandLine_ExportInstrumentFile_Error__The_file__0__could_not_be_saved___Check_that_the_specified_file_directory_exists_and_is_writeable_, args.ExportPath);
                _out.WriteLine(x.Message);
                return false;
            }

@@ -215,6 +222,13 @@ public static bool GoodIfExitCodeIsZero(string stderr, int exitCode)
}

}
catch (IOException ex) // CONSIDER: Should we handle more types like WrapAndThrowException does?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably catch all exception types here, and not worry about the fact that the type of the exception might be getting changed to IOException from whatever its original type might have been.
But this way is fine too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. That makes sense. I was thinking that catching Exception you would throw Exception, but if you catch exception and throw IOException that seems a bit better to me.

@brendanx67
Copy link
Contributor Author

Looks good to me.

It's unfortunate that the way "CommandLine.ExportInstrumentFile" is currently written, it will catch IOException and throw away this new extra information:

            catch (IOException x)
            {
                _out.WriteLine(Resources.CommandLine_ExportInstrumentFile_Error__The_file__0__could_not_be_saved___Check_that_the_specified_file_directory_exists_and_is_writeable_, args.ExportPath);
                _out.WriteLine(x.Message);
                return false;
            }

So, you are suggesting that we use _out.WriteLine(x) instead?

@brendanx67 brendanx67 merged commit 8b17d76 into master Oct 2, 2023
@brendanx67 brendanx67 deleted the Skyline/work/20230927_process_output_ex branch October 2, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants