I put the vbscript in event handler "OnError" for one of my packages (it has sequence container which contain multiple data flow tasks). If any of data flow tasks fail, I want to capture the error message and append to the user variable user::emailText. However, I received error when I ran it.
Description: A deadlock was detected while trying to lock variables "System::ErrorDescription" for read access and variables "User::emailText" for read/write access. A lock cannot be acquired after 16 attempts. The locks timed out.
Here is what I do in vbscript.
On property,
set ReadonlyVariables:System::ErrorDescription
set ReadWriteVariables: User::emailText
Dts.Variables("emailText").Value = Dts.Variables("emailText").Value.ToString + Dts.Variables("System::ErrorDescription").Value + vbCrLf