Source code for labexceptions

# labtools, Copyright (C) 2017 Jerry Fowler and Paul Scheet.
# This program comes with ABSOLUTELY NO WARRANTY. It is licensed under
# GNU GPL Version 3. License and warranty may be viewed in the manual.
'''
A support package for exception-handling. For the time being, there are simply
some exceptions that are to be used to identify issues that were caused by
mistakes in programming interpreted code (branches that did not test, etc).

I hope to add new exceptions to identify specific problems that may have
direct runtime solutions, along with standard exception handling mechanisms
that will take advantage of those problems and address them.
'''


import os
import sys

from labtools import const


[docs]class ProgrammingFlawWarning(Exception): ''' A warning that a condition occurred that clearly indicates a non-subtle programming error. ''' def __init__(self, *args, **kwargs): super(ProgrammingFlawWarning, self).__init__(*args, **kwargs)
[docs]class LabtoolsWarning(Exception): ''' A simple warning generated by code using this library. I handle these warnings as exceptions, so it does not extend UserWarning. ''' def __init__(self, *args, **kwargs): super(LabtoolsWarning, self).__init__(*args, **kwargs)