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 properly. #9

Closed
Wiper-R opened this issue May 19, 2021 · 9 comments
Closed

Handle errors properly. #9

Wiper-R opened this issue May 19, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@Wiper-R
Copy link
Collaborator

Wiper-R commented May 19, 2021

We should consider handling error properly, instead of just raw try-except block.

try:
    ...
except:
    ...

Why this is needed??

message = await channel.send("Some Content!")

# We tried editing it

try:
    await message.edit(content='')
except:
    pass

Can see? above block will just eat all errors while the error is from our side.

@Wiper-R Wiper-R added the enhancement New feature or request label May 19, 2021
@ghost
Copy link

ghost commented May 19, 2021

We should consider handling error properly, instead of just raw try-except block.

try:
    ...
except:
    ...

Yes we should

@ShashankKumarSaxena
Copy link
Member

First tell me jack, what are those three dots called

@ghost
Copy link

ghost commented May 19, 2021

which three dots?

@Wiper-R
Copy link
Collaborator Author

Wiper-R commented May 19, 2021

which three dots?

stfu right now or else u will be blocked

@ShashankKumarSaxena
Copy link
Member

which three dots

bete mauj krdi

@ghost
Copy link

ghost commented May 19, 2021

acha ye?~~~python
...

means ki 
~~~python
try:
 #code will try to do something
except:
#agar code kuch nhi kr paya toh wo ye use krre ga

@Aman-14
Copy link

Aman-14 commented May 19, 2021

Yup, using bare except can cause serious issues in the program, its always a good practice to include a specific Exception.
Read : https://www.flake8rules.com/rules/E722.html#:~:text=When%20catching%20exceptions%2C%20mention%20specific,and%20can%20disguise%20other%20problems.

@AdityaBhushan1
Copy link
Contributor

ye khula kyu hai pull request abhi tak 🤔

@Wiper-R
Copy link
Collaborator Author

Wiper-R commented Jun 10, 2021

ye khula kyu hai pull request abhi tak 🤔

khula hi rahega jabtk sahi nahi hoge wo errors

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants