1. Marcin Kasperski
  2. mekk.fics

Commits

Marcin Kasperski  committed 90607c2

better diagnostics

  • Participants
  • Parent commits 5a2b99a
  • Branches default
  • Tags 0.7.3

Comments (0)

Files changed (1)

File src/mekk/fics/tell_commands/tell_errors.py

View file
  • Ignore whitespace
         self.given_count = given
         if max == 0:
             self.user_msg = "Got unexpected parameter"
-        elif min+1 == max:
-            self.user_msg = "Invalid parameters. Got %d params, expected %d" % (given, min)
+            return
+        if given == 0:
+            got_no = "Got no params"
+        else:
+            got_no = "Got %d params" % given
+        if min+1 == max:
+            self.user_msg = "Invalid parameters. %s, expected %d" % (got_no, min)
         elif max is None:
-            self.user_msg = "Invalid parameters. Got %d params, expected at least %d" % (given, min)
+            self.user_msg = "Invalid parameters. %s, expected at least %d" % (got_no, min)
         else:
-            self.user_msg = "Invalid parameters. Got %d params, expected at from %d to %d" % (given, min, max-1)
+            self.user_msg = "Invalid parameters. %s, expected at from %d to %d" % (got_no, min, max-1)