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

Fix #1421 Update SlackApiError exception handling for web client #1423

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

vinceta
Copy link
Contributor

@vinceta vinceta commented Nov 13, 2023

Summary

This pull request resolves #1421, also updated unit tests and README.

Category (place an x in each of the [ ])

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.signature (Request Signature Verifier)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.models (UI component builders)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.rtm_v2 (RTM client)
  • /docs-src (Documents, have you run ./scripts/docs.sh?)
  • /docs-src-v2 (Documents, have you run ./scripts/docs-v2.sh?)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements (place an x in each [ ])

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

Copy link

Thanks for the contribution! Before we can merge this, we need @vinceta to sign the Salesforce Inc. Contributor License Agreement.

@seratch seratch added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented web-client Version: 3x labels Nov 13, 2023
@seratch seratch modified the milestones: 3.24.0, 3.23.1 Nov 13, 2023
@seratch
Copy link
Member

seratch commented Nov 13, 2023

Hi @vinceta, thanks a lot for sending this PR! Could you check the following points?

  1. Signing the CLA

We are unable to merge your changes without signed CLA. Would you mind checking and signing it ?

  1. Resolving the lint error

the err import is no longer used, so imported module name needs to be removed from the code you've touched.

/home/runner/work/python-slack-sdk/python-slack-sdk/slack_sdk/web/base_client.py:22:1: F401 'slack_sdk.errors as err' imported but unused
/home/runner/work/python-slack-sdk/python-slack-sdk/slack_sdk/web/base_client.py:469:13: F811 redefinition of unused 'err' from line 22
Installing test dependencies ...

https://github.com/slackapi/python-slack-sdk/actions/runs/6846854355/job/18614138792?pr=1423

@vinceta
Copy link
Contributor Author

vinceta commented Nov 13, 2023

@seratch Thanks for your quick response! This's my first PR, apologies for any missing. Please see if any issues still exist, thanks.

Copy link

codecov bot commented Nov 13, 2023

Codecov Report

Merging #1423 (9001914) into main (2d592cd) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1423   +/-   ##
=======================================
  Coverage   85.43%   85.44%           
=======================================
  Files         111      111           
  Lines       11857    11857           
=======================================
+ Hits        10130    10131    +1     
+ Misses       1727     1726    -1     
Files Coverage Δ
slack_sdk/web/base_client.py 89.62% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@seratch seratch self-assigned this Nov 13, 2023
Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

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

Looks great to me! Thanks for fixing this!

@seratch seratch merged commit 2afeba6 into slackapi:main Nov 13, 2023
9 checks passed
@seratch
Copy link
Member

seratch commented Nov 13, 2023

I will work on a patch release including this change tomorrow (or at latest as early as possible this week)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented cla:signed Version: 3x web-client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SlackApiError: 'dict' object has no attribute 'status_code'
2 participants