1

I am a beginner programming a Drone with Python. The issue is, when there is any error the program crashes and the drone continues to fly. Essentially, there is no failsafe.

What is the best way to ensure that if there is an error in my code, I can execute some alternative code to prevent the drone from hanging?

PlantPot
  • 49
  • 6

1 Answers1

1
try:
   dostuff()
except Exception:
   dootherstuff()

for better information look at @Aran-Fey comment