Created
December 15, 2016 06:26
-
-
Save tdmitch/1066e394569a6b19dc6d86db6f9c1f48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If error, write to log and fail | |
if ( | |
// Error conditions: | |
(!(Dts.Variables["vExitCode"].Value.ToString() == "0")) // If exit code = 0 | |
|| exceptionTxt.Length > 0 // Or an exception was captured above | |
|| Dts.Variables["vStdError"].Value.ToString().Length > 0 // Or StdError was captured above | |
) | |
{ | |
string err1 = Dts.Variables["vStdError"].Value.ToString(); | |
string err2 = exceptionTxt; | |
string errFinal = ""; | |
if (err1 != null) | |
{ | |
errFinal += err1.Trim() + System.Environment.NewLine; | |
} | |
if (err2 != null) | |
errFinal += err2.Trim(); | |
Dts.Events.FireError(0, "7Zip Error", errFinal, string.Empty, 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment