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.
| 794 | |
| 795 | |
| 796 | class ArgumentError(Exception): |
| 797 | """An error from creating or using an argument (optional or positional). |
| 798 | |
| 799 | The string value of this exception is the message, augmented with |
| 800 | information about the argument that caused it. |
| 801 | """ |
| 802 | |
| 803 | def __init__(self, argument, message): |
| 804 | self.argument_name = _get_action_name(argument) |
| 805 | self.message = message |
| 806 | |
| 807 | def __str__(self): |
| 808 | if self.argument_name is None: |
| 809 | format = '%(message)s' |
| 810 | else: |
| 811 | format = _('argument %(argument_name)s: %(message)s') |
| 812 | return format % dict(message=self.message, |
| 813 | argument_name=self.argument_name) |
| 814 | |
| 815 | |
| 816 | class ArgumentTypeError(Exception): |
no outgoing calls
no test coverage detected