Skip to content

A one-line error counter with multiple response options.

Notifications You must be signed in to change notification settings

robempire/ErrorBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

ErrorBot

A simple one-line error counter with multiple response options.

Basic Usage:

from errorbot import ErrorBot

bot = ErrorBot()

empty_list = []

for i in range(1,5):     

    print (f'Pass #{i}') 

    try:
        make_error = empty_list[1]

    except:
        bot.check(3)


# [Out]: Pass #1
 
# [Out]: Pass #2
 
# [Out]: Pass #3

# [Out]: ERRORBOT: That's 3 errors since ERRORBOT was created ... Continue? (y/n) 

[In:] Y

# [Out]: Pass #4

ErrorBot also supports several additional arguments for controlling the post-threshold behavior.


Supported arguments:

kill=True:

Exits program without prompting

throw=True:

Raises a UserWarning exception

ask=True

Prompts for [Y/N] input before continuing execution (Default: True)

reset=True:

Resets error counter to 0 after error tolerance reached (Default: True)