Use traceback.format_tb()
instead of print_tb()
to get the formatted stack trace (as a list of lines):
error['traceback'] = ''.join(traceback.format_tb(error_traceback))
print_tb()
directly prints the traceback, that's why you get None
as a result (that's the default for any Python function that doesn't return anything explicitely).