<s> """<STR_LIT>""" <EOL> import re <EOL> import sys <EOL> import traceback <EOL> class ExceptionWithCause ( Exception ) : <EOL> def __init__ ( self , message = '<STR_LIT>' ) : <EOL> self . inner_exception = None <EOL> causing_exception = sys . exc_info ( ) [ <NUM_LIT:1> ] <EOL> if causing_exception : <EOL> self . inner_exception = traceback . format_exc ( ) + ExceptionWithCause . get_cause_if_supported ( causing_exception ) <EOL> super ( ExceptionWithCause , self ) . __init__ ( message ) <EOL> @ staticmethod <EOL> def get_cause_if_supported ( exception ) : <EOL> try : <EOL> inner = exception . inner_exception <EOL> except AttributeError : <EOL> inner = None <EOL> if inner : <EOL> return '<STR_LIT>' . format ( <EOL> tb = inner <EOL> ) <EOL> else : <EOL> return '<STR_LIT>' <EOL> class InvalidArgumentError ( ExceptionWithCause ) : <EOL> pass <EOL> class ConfigurationError ( ExceptionWithCause ) : <EOL> pass <EOL> class ConfigFileNotFoundError ( ConfigurationError ) : <EOL> def __init__ ( self , message = '<STR_LIT>' , config_path = '<STR_LIT>' ) : <EOL> super ( ConfigFileNotFoundError , self ) . __init__ ( message ) <EOL> self . config_path = config_path <EOL> def is_arguments_error ( exception ) : <EOL> return isinstance ( exception , TypeError ) and re . match ( r'<STR_LIT>' <EOL> r'<STR_LIT>' , exception . message ) </s>
