Simplify
This commit is contained in:
parent
8d1330c205
commit
40e167d4fe
1 changed files with 1 additions and 3 deletions
|
@ -37,10 +37,8 @@ async def _(msg: Bot.MessageSession):
|
|||
# error_type = data['error-type']
|
||||
# raise NoReportException(f"{error_type}")
|
||||
|
||||
amount = None
|
||||
while amount is None:
|
||||
amount = float(msg.parsed_msg['<amount>'])
|
||||
try:
|
||||
amount = float(msg.parsed_msg['<amount>'])
|
||||
if amount <= 0:
|
||||
await msg.finish(msg.locale.t('exchange_rate.message.error.non_positive'))
|
||||
except ValueError:
|
||||
|
|
Reference in a new issue