exceptions

This commit is contained in:
Egor Matveev 2021-11-06 21:33:10 +03:00
parent 00ef0abe80
commit 70ff03a6cd

View File

@ -20,11 +20,13 @@ class Command(BaseCommand):
id = int(str(body, encoding='utf-8')) id = int(str(body, encoding='utf-8'))
print(f"Received id {id}") print(f"Received id {id}")
solution = Solution.objects.get(id=id) solution = Solution.objects.get(id=id)
except: except Exception as e:
print(e)
return return
try: try:
eval(solution.language.work_name + 'Tester')(solution).execute() eval(solution.language.work_name + 'Tester')(solution).execute()
except: except Exception as e:
print(e)
solution.result = 'TE' solution.result = 'TE'
solution.save() solution.save()