What the ComponentMetaData.FireError method does in the SSIS component script

I went through MSDN. But he could not correctly understand the method mentioned below.

What does the code below do if it is included in the destination component of the SSIS script?

bool Error = false;
this.ComponentMetaData.FireError(0, "myScriptComponent", 
    "`A Transformation error occurred. Check the corresponding Text File ", 
    "", 0, out Error);`
+5
source share
1 answer

The FireError method raises an error that is compatible with the built-in error handling methods used elsewhere in SSIS. That is, the above code causes an error that occurs when the OnError event occurs.

Parameters that follow the FireError method are described in BOL.

This can be used to provide adequate error handling (which you should always do when writing any custom code). For instance:.

Try

   'Your Code Here

Catch

   'Error handling here
   Me.ComponentMetadata.FireError(...)

end try

.FireError, .Fire... , SSIS, ..FireInformation .

+4

All Articles