Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Home made exception hierarcy

class MyError(Exception):
    pass

class MyGreenError(MyError):
    pass

class MyBlueError(MyError):
    pass


def green():
    raise MyGreenError('Hulk')

def blue():
    raise MyBlueError('Frozen')

def red():
     red_alert()