code: def excinfo(e):
      '''
      Populate err,errmsg,errtrace info from exc.
      '''
      tb = sys.exc_info()[2]
      path, line, name, sorc = traceback.extract_tb(tb)[-1]
      ret = {
          'err': e.__class__.__name__,
          'errmsg': str(e),
          'errfile': path,
          'errline': line,
      }
  
      if isinstance(e, s_exc.SynErr):
          ret['errinfo'] = e.errinfo
  
      return ref excinfo(e):
      '''
      Populate err,errmsg,errtrace info from exc.
      '''
      tb = sys.exc_info()[2]
      path, line, name, sorc = traceback.extract_tb(tb)[-1]
      ret = {
          'err': e.__class__.__name__,
          'errmsg': str(e),
          'errfile': path,
          'errline': line,
      }
  
      if isinstance(e, s_exc.SynErr):
          ret['errinfo'] = e.errinfo
  
      return ret
docs: Populate err,errmsg,errtrace info from exc.