Google Cloud Function to catch BQ Stored proc exception

Viewed 17

I am calling BQ Stored proc via Cloud function and have below try catch block

try:

    sql = """CALL `utl.##`(NULL, 1, 3);"""
    job = client.query(sql)
    job.result()
    print("job executed for query:{}".format(sql))
except Exception as e:
    print("error message:  "+job.error_result['message'])
    print(job.exception())

Stored Proc job status is success but one of the statement failed and throw some exception . I would like to capture that in Cloud function. Is there any way?

0 Answers
Related