I am using Azure Data Factory and Azure Database Instance.
I have a Data Factory Lookup activity that calls a procedure that can fail. In the CATCH
block THROW
is called when a failure occurs. I can see the 'output' of THROW
when inspecting the error popup in the Azure Data Factory client. I am currently unable to access this 'output', it is not output as far as I can tell.
I have tried (each line is an attempt):
@activity('activityName').output.firstRow.error
@activity('activityName').output.firstRow.errors
@activity('activityName').error.message
@activity('activityName').errors.message
@activity('activityName').errors.number
@activity('activityName').ErrorCode
@activity('activityName').Errors
When inspecting the error popup:
Failure happened on 'Source' side. ErrorCode=SqlOperationFailed, 'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException, Message=A database operation failed with the following error: 'blabla', Source=,''Type=System.Data.SqlClient.SqlException, Message=blabla, Source=.Net SqlClient Data Provider, SqlErrorNumber=245, Class=16, ErrorCode=-2146232060, State=1, Errors=[{ Class=16, Number=245,State=1,Message=blabla,},],'
The data is clearly there, just I cannot access it and I am finding the documentation lacking in this case. There is comprehensive documentation on accessing the error output from a CopyActivity but not LookupActivity.
What I am trying to achieve is logging errors. In some cases, the procedure succeeds and needs to submit output to Data Factory which is why I must capture the error data from the THROW
; I have been unable to fail this task by raising the error again with THROW
after returning a SELECT
to Data factory.