MCPcopy Create free account
hub / github.com/apache/madlib / ArgumentError

Class ArgumentError

src/madpack/argparse.py:712–729  ·  view source on GitHub ↗

An error from creating or using an argument (optional or positional). The string value of this exception is the message, augmented with information about the argument that caused it.

Source from the content-addressed store, hash-verified

710
711
712class ArgumentError(Exception):
713 """An error from creating or using an argument (optional or positional).
714
715 The string value of this exception is the message, augmented with
716 information about the argument that caused it.
717 """
718
719 def __init__(self, argument, message):
720 self.argument_name = _get_action_name(argument)
721 self.message = message
722
723 def __str__(self):
724 if self.argument_name is None:
725 format = '%(message)s'
726 else:
727 format = 'argument %(argument_name)s: %(message)s'
728 return format % dict(message=self.message,
729 argument_name=self.argument_name)
730
731
732class ArgumentTypeError(Exception):

Callers 7

__call__Method · 0.85
take_actionMethod · 0.85
consume_optionalMethod · 0.85
_match_argumentMethod · 0.85
_get_valueMethod · 0.85
_check_valueMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected