Code Duplication    Length = 11-11 lines in 2 locations

gvm/errors.py 2 locations

@@ 78-88 (lines=11) @@
75
        self.argument = argument
76
        self.function = function
77
78
    def __str__(self):
79
        if self.message:
80
            return self.message
81
82
        if not self.function:
83
            return "Required argument {}".format(self.argument)
84
85
        if not self.argument:
86
            return "Required argument missing for {}".format(self.function)
87
88
        return "{} requires a {} argument".format(self.function, self.argument)
89
@@ 48-58 (lines=11) @@
45
        self.argument = argument
46
        self.function = function
47
48
    def __str__(self):
49
        if self.message:
50
            return self.message
51
52
        if not self.function:
53
            return "Invalid argument {}".format(self.argument)
54
55
        if not self.argument:
56
            return "Invalid argument for {}".format(self.function)
57
58
        return "Invalid argument {} for {}".format(self.argument, self.function)
59
60
61
class RequiredArgument(GvmError):