Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Exceptions in C# are handled in the same way as they are in Python, with only minor syntactic differences:
try {
robot.ReturnToBase(TransportMode.FootThrusters);
} catch (FootThrusterFailure) {
robot.ReturnToBase(TransportMode.BoringWalking);
} catch (EmergencyOverrideException e) {
robot.SelectTarget(e.NewTarget);
} catch {
robot.AssumeDefensivePosition();
throw; // re-throw the original exception
} finally {
robot.NotifyBase();
}