Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在網路斷線情況下去取資料,request_get無法正確回傳Exception訊息 #279

Closed
cyyeh opened this issue Dec 18, 2023 · 2 comments
Assignees

Comments

@cyyeh
Copy link

cyyeh commented Dec 18, 2023

Describe the bug (please complete the following information)[清晰簡潔的描述 bug]
A clear and concise description of what the bug is.

在網路斷線情況下去取資料,request_get 無法正確回傳Exception訊息,因為此時reponse的值是空的,因此 if response.json()["msg"] == "success" and response.status_code == 200:會噴錯

To Reproduce (please complete the following information)[一步一步說明如何重現 bug]
Steps to reproduce the behavior:

  1. 斷網
  2. 呼叫FinMind api
  3. 出現The “local variable referenced before assignment” error

Expected behavior (please complete the following information)[清晰簡潔的描述你預期的結果]
A clear and concise description of what you expected to happen.

應該要回傳Exception

Desktop (please complete the following information):[提供程式的執行環境]

  • OS: Mac
  • Browser: Chrome
  • Python Version: 3.10
  • FinMind package Version: 1.6.4
@linsamtw linsamtw self-assigned this Jan 7, 2024
@linsamtw
Copy link
Collaborator

linsamtw commented Jan 7, 2024

#286

@linsamtw
Copy link
Collaborator

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants