exp is now exc
This commit is contained in:
@@ -43,21 +43,21 @@ async def callback_query_yes(app: PyroClient, clb: CallbackQuery):
|
||||
show_alert=True,
|
||||
)
|
||||
return
|
||||
except SubmissionDuplicatesError as exp:
|
||||
except SubmissionDuplicatesError as exc:
|
||||
await clb.answer(
|
||||
text=app._("sub_duplicates_found", "callback", locale=user.locale),
|
||||
show_alert=True,
|
||||
)
|
||||
await clb.message.reply_text(
|
||||
app._("sub_media_duplicates_list", "message", locale=user.locale).format(
|
||||
"\n • ".join(exp.duplicates)
|
||||
"\n • ".join(exc.duplicates)
|
||||
),
|
||||
quote=True,
|
||||
)
|
||||
logger.info(
|
||||
"Submission with ID '%s' could not be accepted because of the duplicates: %s",
|
||||
fullclb[2],
|
||||
str(exp.duplicates),
|
||||
str(exc.duplicates),
|
||||
)
|
||||
return
|
||||
|
||||
@@ -146,7 +146,7 @@ async def callback_query_no(app: PyroClient, clb: CallbackQuery):
|
||||
submission = await app.get_messages(
|
||||
db_entry["user"], db_entry["telegram"]["msg_id"]
|
||||
)
|
||||
except Exception as exp:
|
||||
except Exception as exc:
|
||||
await clb.answer(
|
||||
text=app._("sub_msg_unavail", "message", locale=user.locale),
|
||||
show_alert=True,
|
||||
|
@@ -123,16 +123,16 @@ async def cmd_import(app: PyroClient, msg: Message):
|
||||
for name in handle.namelist()
|
||||
]
|
||||
_ = await asyncio.gather(*tasks)
|
||||
except Exception as exp:
|
||||
except Exception as exc:
|
||||
logger.error(
|
||||
"Could not import '%s' due to %s: %s",
|
||||
answer.document.file_name,
|
||||
exp,
|
||||
exc,
|
||||
format_exc(),
|
||||
)
|
||||
await answer.reply_text(
|
||||
app._("import_unpack_error", "message", locale=user.locale).format(
|
||||
exp, format_exc()
|
||||
exc, format_exc()
|
||||
)
|
||||
)
|
||||
return
|
||||
@@ -165,12 +165,12 @@ async def cmd_import(app: PyroClient, msg: Message):
|
||||
compress=False,
|
||||
caption="queue",
|
||||
)
|
||||
except UnexpectedStatus as exp:
|
||||
except UnexpectedStatus as exc:
|
||||
logger.error(
|
||||
"Could not upload '%s' from '%s': %s",
|
||||
filename,
|
||||
Path(f"{app.config['locations']['tmp']}/{tmp_dir}"),
|
||||
exp,
|
||||
exc,
|
||||
)
|
||||
await msg.reply_text(
|
||||
app._(
|
||||
|
@@ -237,16 +237,16 @@ async def get_submission(app: PyroClient, msg: Message):
|
||||
quote=True,
|
||||
)
|
||||
return
|
||||
except SubmissionDuplicatesError as exp:
|
||||
except SubmissionDuplicatesError as exc:
|
||||
await msg.reply_text(
|
||||
app._(
|
||||
"sub_media_duplicates_list", "message", locale=user.locale
|
||||
).format("\n • ".join(exp.duplicates)),
|
||||
).format("\n • ".join(exc.duplicates)),
|
||||
quote=True,
|
||||
)
|
||||
return
|
||||
except Exception as exp:
|
||||
await msg.reply_text(format_exc(), quote=True)
|
||||
except Exception as exc:
|
||||
await msg.reply_text(exc, quote=True)
|
||||
return
|
||||
elif (
|
||||
msg.from_user.id not in app.admins
|
||||
@@ -270,12 +270,12 @@ async def get_submission(app: PyroClient, msg: Message):
|
||||
)
|
||||
)
|
||||
return
|
||||
except SubmissionDuplicatesError as exp:
|
||||
except SubmissionDuplicatesError as exc:
|
||||
await msg.reply_text(
|
||||
app._("sub_dup", "message", locale=user.locale), quote=True
|
||||
)
|
||||
return
|
||||
except Exception as exp:
|
||||
except Exception as exc:
|
||||
await app.send_message(
|
||||
app.owner,
|
||||
app._(
|
||||
|
Reference in New Issue
Block a user