Previous topic

4. The SUPPRESS class

Next topic

6. Helper Functions

This Page

5. The ReaderError exception

exception input_reader.ReaderError(msg)

An exception for the InputReader class.

Whenever there is an error parsing the input file, a ReaderError exception will be raised. This will also be raised if there an InputReader-specific error in the key definitions, such as defining the same key twice. A common use case might be:

from input_reader import InputReader, ReaderError
reader = InputReader()
# key definitions go here #
try:
    inp = reader.read_file('user_inputs.txt')
except ReaderError as e:
    from sys import exit
    exit(str(e))