How to troubleshoot/get error response when you run invalid BigQuery jobs?

后端 未结 2 573
走了就别回头了
走了就别回头了 2021-01-21 05:31

In this code, I try to run a select on a table that doesn\'t exists, getJobReference() returns NULL and I would love to catch this kind of error, and w

2条回答
  •  -上瘾入骨i
    2021-01-21 06:09

    I don't know this SDK very well, but did you check if you get an exception?

    try {
        $insert = new Google_Service_Bigquery_Job($bq->jobs->insert(PROJECT_ID, $job));
    }
    catch (Exception $e) //or probably better Google_Exception
    {
        print('Something went wrong');
    }
    

提交回复
热议问题