Capture No valid DataKeys Message

ssmith-nova
New Contributor III

I have a BR that runs a load process using ExecuteParseAndTransform.  When the data source is empty for that profile it throws the "No valid DataKeys" error and stops the job.  I don't even get the opportunity to check the status code of the import. 

Is there a way to catch that error when using the ExecuteParseAndTransform method? 

Thanks,

Scott

2 ACCEPTED SOLUTIONS

franciscoamores
Contributor II

Hi, You can capture the exception and check the exception message

View solution in original post

ssmith-nova
New Contributor III
Try
  ImportInfo  = BRApi.Import.Process.ExecuteParseAndTransform(si, wfClusterPk, String.Empty, Nothing, TransformLoadMethodTypes.Replace, SourceDataOriginTypes.FromDirectConnection, False)

Catch ex As Exception
   log.AppendLine(ex.ToString)
End Try

This is what I am doing. 

 

View solution in original post

5 REPLIES 5

franciscoamores
Contributor II

Hi, You can capture the exception and check the exception message

ssmith-nova
New Contributor III

Thank you, I missed the obvious.  I was catching the error, but then I was throwing an exception.  If I just capture the error and move on, I am good.  

seangly
New Contributor III

Hi, 

Do you know how you can catch the error, when I ouput my exception message, it's seem to be blank.

Regards,
Seang

ssmith-nova
New Contributor III
Try
  ImportInfo  = BRApi.Import.Process.ExecuteParseAndTransform(si, wfClusterPk, String.Empty, Nothing, TransformLoadMethodTypes.Replace, SourceDataOriginTypes.FromDirectConnection, False)

Catch ex As Exception
   log.AppendLine(ex.ToString)
End Try

This is what I am doing. 

 

seangly
New Contributor III

Thank for your update.
I that message is to technical and long. 
I used a shorter version
failureSummary.AppendLine(ex.StackTrace.ToString)