Last active
February 7, 2025 02:44
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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