124 the_webhook: discord.Webhook = discord.Webhook.from_url(webhook_url, session=session)
125 try:
126 await the_webhook.send(**message_body)
127 except Exception:128 pass
129
130class Logger:
464 else:
465 await info.message.clear_reactions()
466 return None, None
467 except Exception:468 pass
469 else:
470 if info.delete_after:
413 if info.convertor in [str, int, pytimeparse.parse]:
414 try:
415 ret = info.convertor(response.content)
416 except Exception:417 ret = None
418
419 if ret is None:
365 else:
366 await info.message.clear_reactions()
367 return None, None
368 except Exception:369 pass
370 else:
371 if info.delete_after:
299 ret = info.convertor(response.content), response
300 else:
301 ret = info.convertor(response.content)
302 except Exception:303 ret = None
304
305 if ret is None:
If the except block catches a very general exception, it is likely to catch any unrelated errors too. Try to be more explicit about which exception(s) you're trying to catch.
If you need to catch every other exception, then mark it as intentional by
adding a # skipcq
comment.
try:
x = a / b
except Exception:
x = a / (b + 1)
try:
line = input('Enter numbers:')
numbers = [int(i) for i in line.split()]
except BaseException:
print('Only use numbers for the input')
try:
x = a / b
except ZeroDivisionError:
x = a / (b + 1)
try:
event_loop.run()
except Exception as exc: # skipcq: PYL-W0703 - Loop can sometimes crash.
sentry.report(exc)
try:
line = input('Enter numbers:')
numbers = [int(i) for i in line.split()]
except ValueError:
print('Only use numbers for the input')