Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active February 7, 2025 02:44
Show Gist options
  • Save mcsee/245571d7abd11ef733f02b850be470af to your computer and use it in GitHub Desktop.
Save mcsee/245571d7abd11ef733f02b850be470af to your computer and use it in GitHub Desktop.
This gist belongs to Clean Code Cookbook http://cleancodecookbook.com By Maximiliano Contieri http://maximilianocontieri.com
class KlendathuInvasionError(Exception):
def __init__(self, message):
self.message = message
# This is a hollow exception
def deploy_troops(safe):
if not safe:
KlendathuInvasionError("Drop zone is hot!")
# Never thrown
print("Troopers deployed.")
deploy_troops(False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment