Merge pull request #13738 from bcoca/callback_stacktrace
now show full callback stacktrace when vvv+
This commit is contained in:
commit
19af43ed5d
2 changed files with 15 additions and 5 deletions
|
@ -290,8 +290,13 @@ class TaskQueueManager:
|
||||||
try:
|
try:
|
||||||
method(*args, **kwargs)
|
method(*args, **kwargs)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
import traceback
|
||||||
|
orig_tb = traceback.format_exc()
|
||||||
try:
|
try:
|
||||||
v1_method = method.replace('v2_','')
|
v1_method = method.replace('v2_','')
|
||||||
v1_method(*args, **kwargs)
|
v1_method(*args, **kwargs)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
if display.verbosity >= 3:
|
||||||
|
display.warning(orig_tb, formatted=True)
|
||||||
|
else:
|
||||||
display.warning('Error when using %s: %s' % (method, str(e)))
|
display.warning('Error when using %s: %s' % (method, str(e)))
|
||||||
|
|
|
@ -202,10 +202,15 @@ class Display:
|
||||||
self.display(new_msg.strip(), color=C.COLOR_DEPRECATE, stderr=True)
|
self.display(new_msg.strip(), color=C.COLOR_DEPRECATE, stderr=True)
|
||||||
self._deprecations[new_msg] = 1
|
self._deprecations[new_msg] = 1
|
||||||
|
|
||||||
def warning(self, msg):
|
def warning(self, msg, formatted=False):
|
||||||
|
|
||||||
|
if not formatted:
|
||||||
new_msg = "\n[WARNING]: %s" % msg
|
new_msg = "\n[WARNING]: %s" % msg
|
||||||
wrapped = textwrap.wrap(new_msg, self.columns)
|
wrapped = textwrap.wrap(new_msg, self.columns)
|
||||||
new_msg = "\n".join(wrapped) + "\n"
|
new_msg = "\n".join(wrapped) + "\n"
|
||||||
|
else:
|
||||||
|
new_msg = "\n[WARNING]: \n%s" % msg
|
||||||
|
|
||||||
if new_msg not in self._warns:
|
if new_msg not in self._warns:
|
||||||
self.display(new_msg, color=C.COLOR_WARN, stderr=True)
|
self.display(new_msg, color=C.COLOR_WARN, stderr=True)
|
||||||
self._warns[new_msg] = 1
|
self._warns[new_msg] = 1
|
||||||
|
|
Loading…
Reference in a new issue