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
Conversation
…ould otherwise be lost - for diagnosing method export failures
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. |
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. |
There was a problem hiding this 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? |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
So, you are suggesting that we use _out.WriteLine(x) instead? |
…ProteoWizard/pwiz into Skyline/work/20230927_process_output_ex
…would otherwise be lost