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

how 'catch' "unknown error occurred" ? #103

Closed
jpwynn opened this issue Jun 9, 2022 · 2 comments
Closed

how 'catch' "unknown error occurred" ? #103

jpwynn opened this issue Jun 9, 2022 · 2 comments

Comments

@jpwynn
Copy link

jpwynn commented Jun 9, 2022

in my code I use

    try:
      msg.delete(replies=True, files=True)
      time.sleep(.5)
    except Exception as e:
       <code to print "F" to console as I look thru conversations>

But when an "unknown error" occurs it;s not throwing an exception I can catch, it's printing a message, so I get a LOT of these messages:

conversations.replies: unknown error occurred: The request to the Slack API failed. (url: https://www.slack.com/api/conversations.replies) The server responded with: {'ok': False, 'error': 'thread_not_found'}

It seems like rather than print a message it ought to throw an exception that can be caught and handled?

@jpwynn
Copy link
Author

jpwynn commented Jun 9, 2022

oops wrong version of slack cleaner I'm using 2

@jpwynn jpwynn closed this as completed Jun 9, 2022
@sgratzl
Copy link
Owner

sgratzl commented Jun 12, 2022

take a look at the return value of delete. https://github.com/sgratzl/slack_cleaner2/blob/main/slack_cleaner2/model.py#L437

yes it is designed to keep working on errors but it returns the error if it encounters one.

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