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.
| 762 | |
| 763 | |
| 764 | class ArgumentError(Exception): |
| 765 | """An error from creating or using an argument (optional or positional). |
| 766 | |
| 767 | The string value of this exception is the message, augmented with |
| 768 | information about the argument that caused it. |
| 769 | """ |
| 770 | |
| 771 | def __init__(self, argument, message): |
| 772 | self.argument_name = _get_action_name(argument) |
| 773 | self.message = message |
| 774 | |
| 775 | def __str__(self): |
| 776 | if self.argument_name is None: |
| 777 | format = '%(message)s' |
| 778 | else: |
| 779 | format = _('argument %(argument_name)s: %(message)s') |
| 780 | return format % dict(message=self.message, |
| 781 | argument_name=self.argument_name) |
| 782 | |
| 783 | |
| 784 | class ArgumentTypeError(Exception): |
no outgoing calls
no test coverage detected