MCPcopy
hub / github.com/tanelpoder/0xtools / ArgumentError

Class ArgumentError

lib/0xtools/argparse.py:705–722  ·  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

703
704
705class ArgumentError(Exception):
706 """An error from creating or using an argument (optional or positional).
707
708 The string value of this exception is the message, augmented with
709 information about the argument that caused it.
710 """
711
712 def __init__(self, argument, message):
713 self.argument_name = _get_action_name(argument)
714 self.message = message
715
716 def __str__(self):
717 if self.argument_name is None:
718 format = '%(message)s'
719 else:
720 format = 'argument %(argument_name)s: %(message)s'
721 return format % dict(message=self.message,
722 argument_name=self.argument_name)
723
724
725class 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