Skip to content

Instantly share code, notes, and snippets.

Created Jan 23, 2016
Embed
What would you like to do?
// Do-nothing variable required for FireInformation below
bool fireagain = true;
// Log output to SSIS log
if (returnVal != 0 || errStr.Length > 0) // Error
{
if (errStr.Length > 0)
Dts.Events.FireError(0, "WinSCP Exception", errStr.Replace("'", "\"").Replace("--", " - "), "", 0);
if (outStr.Length > 0)
Dts.Events.FireError(0, "WinSCP error", "A WinSCP error has occurred. The full output stack follows: " + outStr.Replace("'", "\"").Replace("--", " - "), "", 0);
}
else // No error
Dts.Events.FireInformation(0, "WinSCP output", outStr, string.Empty, 0, ref fireagain);
Dts.TaskResult = (returnVal != 0) ? (int)ScriptResults.Failure : (int)ScriptResults.Success;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment