loadbalancer-controller icon indicating copy to clipboard operation
loadbalancer-controller copied to clipboard

TypeError: not enough arguments for format string

Open 42B opened this issue 6 years ago • 0 comments

https://github.com/sendgrid/krampus/blob/738f00652abc93302db5b1205ab3ba45f2507463/kinder/lambda_funcs.py#L36

>>> try:
...     raise ValueError
... except Exception as e:
...     print("could not delete function '%s', unknown error: %s" % str(e))
... 
Traceback (most recent call last):
  File "<input>", line 2, in <module>
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<input>", line 4, in <module>
TypeError: not enough arguments for format string

# minimal example
>>> "could not delete function '%s', unknown error: %s" % "Exception string..."
Traceback (most recent call last):
  File "<input>", line 1, in <module>
TypeError: not enough arguments for format string

It seems like adding self.func as the first string might be the answer:

KLog.log("could not delete function '%s', unknown error: %s" % (self.func, str(e)), "critical")

42B avatar Oct 26 '18 21:10 42B