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.
| 710 | |
| 711 | |
| 712 | class 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 | |
| 732 | class ArgumentTypeError(Exception): |
no outgoing calls
no test coverage detected