cube-js/cube

@cubejs-client/core load method error does not contain HTTP error code

Open

#833 建立於 2020年7月14日

在 GitHub 查看
 (4 留言) (6 反應) (0 負責人)Rust (1,965 fork)batch import
client:corehelp wanted

倉庫指標

Star
 (19,563 star)
PR 合併指標
 (平均合併 5天 16小時) (30 天內合併 138 個 PR)

描述

Describe the bug In @cubejs-client/core, when an errors occurs, there is no way to get errors the HTTP error code.

To Reproduce

  1. Make a request using @cubejs-client/core like this
const makeQuery = async () => {
  const cubejsApi = cubejs(
    'CUBEJS-API-TOKEN',
    { apiUrl: 'http://localhost:4000/cubejs-api/v1' }
  );

  try {
    const response = await cubejsApi.load(query);
    return response.chartPivot();
  } catch (error) {
    console.log(error);
  }
}
  1. error in the catch block does not contain http error code

Expected behavior error should contain the HTTP error code

Version: ^0.15.4

Additional context

貢獻者指南