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

Handle errors messages from delete response stream #1697

Merged
merged 2 commits into from
Sep 1, 2020

Conversation

romasku
Copy link
Contributor

@romasku romasku commented Aug 20, 2020

@romasku romasku force-pushed the rs/handle-errors-in-delete-stream branch from 05502a2 to 592233c Compare August 20, 2020 12:04
@codecov
Copy link

codecov bot commented Aug 20, 2020

Codecov Report

Merging #1697 into master will decrease coverage by 0.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1697      +/-   ##
==========================================
- Coverage   87.17%   86.99%   -0.18%     
==========================================
  Files          59       59              
  Lines        8808     8821      +13     
  Branches     1435     1438       +3     
==========================================
- Hits         7678     7674       -4     
- Misses        863      897      +34     
+ Partials      267      250      -17     
Flag Coverage Δ
#e2e 64.22% <47.05%> (+1.26%) ⬆️
#unit 76.95% <88.23%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
neuromation/api/jobs.py 94.19% <100.00%> (+0.02%) ⬆️
neuromation/api/storage.py 95.87% <100.00%> (+0.10%) ⬆️
neuromation/cli/ael.py 47.71% <0.00%> (-14.98%) ⬇️
neuromation/cli/formatters/jobs.py 79.10% <0.00%> (-1.58%) ⬇️
neuromation/cli/job.py 84.64% <0.00%> (+0.62%) ⬆️
neuromation/cli/click_types.py 74.76% <0.00%> (+3.73%) ⬆️
neuromation/cli/formatters/images.py 94.23% <0.00%> (+4.80%) ⬆️
neuromation/api/images.py 94.81% <0.00%> (+7.40%) ⬆️
neuromation/cli/image.py 100.00% <0.00%> (+44.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6433792...5e4acc6. Read the comment docs.

err_text = server_message["error"]
os_errno = server_message.get("errno", None)
if os_errno is not None:
os_errno = errno.__dict__.get(os_errno, os_errno)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm missed. What is errno type here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errno here is module instance (it comes from import errno). This is code is almost same as in _Core.request.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got you

Copy link
Contributor

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add similar code for other response stream (storage ls, job ls)?

@romasku romasku force-pushed the rs/handle-errors-in-delete-stream branch from 3ffbc26 to 5e4acc6 Compare August 20, 2020 17:05
@asvetlov asvetlov merged commit e7f2499 into master Sep 1, 2020
@asvetlov asvetlov deleted the rs/handle-errors-in-delete-stream branch September 1, 2020 08:32
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

Successfully merging this pull request may close these issues.

3 participants