Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Automatic failure of a Dataform Action

Hello Community,

I have the following situation: At some moment in time one Dataform Action fails. We have a code segment like this:

BEGIN

    SQL Code that may fail

    Exception

END

Although we have the Exception block where we log the error by catching the error we stop the failure to propagate to Dataform Executions board.

We need to catch the Exception but to also fail the Execution flow. Can we manually trigger the failure of the Dataform Action?

Thank you and Best regards,

Valentin

Solved Solved
0 1 176
1 ACCEPTED SOLUTION

Hello Community,
I was able to find a solution for this issue: please see the code:

 
EXCEPTION
-- Handle Exception
    WHEN ERROR THEN ROLLBACK TRANSACTION;
    RAISE USING message = FORMAT("Execution of %s %s line, caused the error: %s.", @@error.statement_text, @@error.formatted_stack_trace, @@error.message);          

View solution in original post

1 REPLY 1

Hello Community,
I was able to find a solution for this issue: please see the code:

 
EXCEPTION
-- Handle Exception
    WHEN ERROR THEN ROLLBACK TRANSACTION;
    RAISE USING message = FORMAT("Execution of %s %s line, caused the error: %s.", @@error.statement_text, @@error.formatted_stack_trace, @@error.message);