[英]More detailed error messages from Node.js BigQuery client library
我正在使用BigQuery 的官方 Google Node 連接器。
我有以下代碼片段將記錄流式傳輸到數據庫中:
module.exports.sendToBigQuery = (rows) => {
bigquery
.dataset(DATASET_NAME)
.table(TABLE_NAME)
.insert(rows)
.catch(err => {
if (err && err.name === 'PartialFailureError') {
if (err.errors && err.errors.length > 0) {
console.log('Insert errors:');
err.errors.forEach(err => console.error(err));
}
} else {
console.error('ERROR:', err);
}
});
};
不幸的是,每當我的數據與模式不匹配時,我得到的只是這個神秘的錯誤對象: { errors: [ { message: 'no such field.', reason: 'invalid' } ],
沒有location
字段可以告訴我缺少哪個字段,這使得調試此代碼成為更復雜模式的噩夢。
有沒有辦法以某種方式啟用錯誤的調試級別? 或者它只是客戶端實現中的一個錯誤? 知道我如何訪問這些信息嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.